Gzip WebApi Response Content using an attribute

Today I was asked why json responses from WebApi was not being gzipped since it brought down our score on Google Page Speed. So yet again I started my ongoing fight with Google Page Speed. It turns out that we had issues making IIS gzip application/json data. Since we do not have direct access to the production environment I decided that we would be better off simply gzipping the response content in code where and when we wanted to. ...

May 19, 2015 · 3 min · alc

Working with custom MongoDB collections in Sitecore 8 using WebApi

The introduction of the xDB to the Sitecore eXperience Platform offer a ton of new options for us Sitecore developers. As a bonus we suddenly have a data store for anything at any time instead of either trying to make the data fit into Sitecore items or give up and go with a custom database. Now we can just use mongo for almost anything. In this post I will show how extremely simple it is to get and set data in a custom mongo collection. ...

January 24, 2015 · 3 min · alc

Implementing a WebApi service using ServicesApiController in Sitecore 8

This will just be a quick post about implementing a WebApi controller in Sitecore 8 using the ServicesApiController class. Perhaps this post can help some of the teams in the ongoing Sitecore Hackathon, who knows. The ServicesApiController class Sitecore.Services introduce a new abstract class called ServicesApiController that derives from the System.Web.ApiController. The class itself only purpose is to identify an ApiController as being a Sitecore ServicesApiController. This identification is used by some WebApi filters that is added in the include config file Sitecore.Services.client.config ...

January 24, 2015 · 4 min · alc

Azure API Management and output cache policies

I am writing this post because I was one day confronted with the situation when I had to move a whole bunch of HTTP Services to be called via Azure API Management. These services were serving mobile calls from both iOS and Android devices. All nice and well but the problem I got was that some of these services should have their response cached for a period of time so that the apps would not call them every single time. The API management does indeed provide some settings to set caching but for some reason whenever the apps would call any of the cached services the “Cache-Control” header was always set to private instead of public as it was desired ( here is some interesting reading about Cache-control headers ). ...

September 24, 2014 · 1 min · ap