Gzip svg sitecore

How to gzip svg files in ASP.NET

My previous pos t showed how to gzip svg files served by the Sitecore media library. This is fine if all svg files reside in the media library but this is typical not the case. In this post I will show how to gzip compress any svg files served by your ASP.NET solution. As I explained in my previous post the issue that I am attempting to solve is that IIS will not by default gzip svg files without a lot of configuration changes on server level. ...

September 3, 2014 · 2 min · alc
Gzip svg sitecore

How to compress SVG images from the Sitecore media library

This blog post is long overdue. The code was written some time last year when I started my still on-going fight with Google Page Speed. When Sitecore deliver svg files from the media library there is no out-of-the-box approach for gzipping the media content and setting the Content-encoding response header to gzip. Gzipping the svg media content First we need to gzip the media content. To do this we insert the following processor into the end of the getMediaStream pipeline. ...

September 1, 2014 · 3 min · alc
markdown_preview

How to use a subset of markdown in Sitecore text fields

This is my first blog post for some months now so I’ll start somewhat easy. I attended a design presentation meeting this Friday where the customer presented a nice and simple design based on bootstrap for their new website. All was great about the design but then I noticed something funny about the spot headlines used in the design. The headlines looked somewhat like this: This is what a headline could look like Notice how the headline uses a slim text whilst some of the words are bold, also notice the irregular line-break. ...

August 17, 2014 · 5 min · alc
EngagementPlan

Sitecore Analytics rules with custom user properties

This post will show how to create an Engagement plan rule that uses custom fields. The idea is that the users have custom fields on their profile related to newsletter distribution groups. The goal is to create an engagement plan where we have a rule condition saying something like this : The engagement plan using this condition has a user in the initial state, a condition validator and a second state where the user will be put if the condition validates. An email will be sent after the validation (in this case). ...

June 13, 2014 · 3 min · ap
typescript

3 reasons why TypeScript is brilliant

I had the pleasure of attending a talk with Anders Hejlsberg from Microsoft today at the Copenhagen University department of computer science. The talk was an introduction master class to TypeScript and even though I played a bit around with TypeScript before it was so cool and beneficial to hear about it from the mind who created it. I am still somewhat of a TypeScript newbie but since I am so excited about what I saw today at the talk I will share some of the things which I think is so extremely brilliant. ...

March 14, 2014 · 5 min · alc
dmssql

Sitecore DMS visits from specific IP addresses

Sitecore DMS stores IP addresses as a varbinary(16) in the Visits table in the analytics database. This is just perfect but it is impossible to read the IP addresses as a normal human being. To help out with this I found the following SQL function which can convert an IPv4 address to a binary. CREATE FUNCTION dbo.fnBinaryIPv4(@ip AS VARCHAR(15)) RETURNS BINARY(4) AS BEGIN DECLARE @bin AS BINARY(4) SELECT @bin = CAST( CAST( PARSENAME( @ip, 4 ) AS INTEGER) AS BINARY(1)) + CAST( CAST( PARSENAME( @ip, 3 ) AS INTEGER) AS BINARY(1)) + CAST( CAST( PARSENAME( @ip, 2 ) AS INTEGER) AS BINARY(1)) + CAST( CAST( PARSENAME( @ip, 1 ) AS INTEGER) AS BINARY(1)) RETURN @bin END So let say that you want to delete all visits from localhost, simply run the following SQL statement using Sql Server Management Studio. ...

March 13, 2014 · 3 min · alc
oie_121156406SOzBwIF

Filter out IP addresses in Sitecore DMS

Today I was asked by a customer to filter out their internal IPs from all DMS reports. There are two approaches for obtaining this. Either very simply add the IP addresses to the Sitecore.Analytics.ExcludeRobots.config as excludedIPAddresses. But I did not like this approach. The customer editors are not robots, so this is messing up domain entities.. Instead I took a different approach and simply wrote a new processor for the startAnalytics pipeline. ...

March 12, 2014 · 3 min · alc
queuedistinct

How to stop Sitecore ECM from spamming duplicate recipients

In the current version of ECM the same mail message will be sent several times to the same user if the user has registered several times to the same target audience with a different user but the same email. The issue is really that the email recipients are not filtered by distinct emails before the newsletter is dispatched. Personally I would have thought that ECM ensured that emails was distinct before it dispatches the mail but this is not the case ...

March 7, 2014 · 3 min · alc
caches

Modifying cache keys in Sitecore

Sitecore ships with some very effective cache mechanisms. One of these mechanisms is the html cache where the output of a rendered control is cached in a table which has a key for each entry. The generated key can vary by different parameters which can be set on the sublayout, xslt, view rendering etc. The vary by possibilities are inherited from the system base template called caching. ...

February 25, 2014 · 4 min · alc
404notfound

Handling 404 in a Sitecore multisite solution and avoid 302 redirects

This post shows how to handle a request for a page which is not found, how to avoid having the request being redirected with a 302 status code before a 404 and finally how to use different pages within Sitecore for not found pages in a multisite solution. The post is based on some code I wrote back in June 2012 and I have seen the concept used several places since then so a lot of you will know it already and might already have it implemented yourselves in some form. ...

February 10, 2014 · 6 min · alc