custom_caches_in_Sitecore

How to create a custom cache in Sitecore

When coding a Sitecore solution you sometimes need a cache to store some values. I’ve seen a lot of different cache implementations in Sitecore solutions that do not use the Sitecore API. Such an implementation could for example use a static or perhaps a singleton some even go further and use a custom database or a nosql document database such as RavenDB or Mongo. It is very rare that these implementations could not simply be replaced by using the built-in Sitecore caching API. ...

October 26, 2014 · 4 min · alc
mailserver

Sending emails in Sitecore

Sometimes you need to send an email from your Sitecore code. I’ve seen a ton of solution implementations where the developer have written some custom class that sends out emails using a SMTP client, good old classic ASP.NET. I myself even wrote code for that in Sitecore solutions some years ago. That was before I noticed the very simple method on the Sitecore.MainUtil class called SendMail. The SendMail does exactly what you expect it to do. ...

October 26, 2014 · 2 min · alc
wildcardparser

Matching Wildcards in Sitecore

While reading this nice blog post by my colleague Uli about resolving a Sitecore SiteContext from an URI I noticed that he used a regex to match a hostname using * as a wildcard That made me remember the Sitecore class called Sitecore.Text.WildcardParser. I once wrote a blog post about this class but I never got around to publish it. So now I’ll try again and keep it short. The WildcardParser class is pretty unknown even though it is an oldie in the Sitecore API. It can be used to match a string value with an array of strings where a * means wildcard. It is used by Sitecore to check if a SiteInfo class matches a hostname. An example usage of the class could look like this: ...

October 26, 2014 · 1 min · alc