Developer forum

Forum » CMS - Standard features » How to add Expires headers

How to add Expires headers

Tom-Erik Paulsen
Reply

The point of using browser caching and expiry headers is to reduce the number of HTTP requests, which improves the performance for your returning visitors. The first time someone visits your site, their browser will fetch all your images, css files, javascript files, etc. Normally that happens every time the same visitor comes back to your site. With Expires headers you tell your website visitor’s browser that the files you specify are not changing until after a certain time, for example a month.

My question is, where could this be configured in DW. Do I have to do it manualy via RDP and in IIS?
https://technet.microsoft.com/en-us/library/cc770661(v=ws.10).aspx
 


http://www.***.no/Admin/Content/JsLib/dw/Analytics.js (expiration not specified)
http://www.***.no/Files/Billeder/Forside%20oppe/DM-11-slide.jpg (expiration not specified)
http://www.***.no/Files/Billeder/forside-oppe/Stauder-oldemor-ny.jpg (expiration not specified)
http://www.***.no/Files/Billeder/forside-oppe/asters-host.jpg (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/***_style.css (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/css/cloudfonts.css (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/css/cookiecuttr.css (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/css/font-awesome.min.css (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/css/opensans.css (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/css/style.css (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/images/***_blogg.png (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/images/***_dark_fade.png (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/images/***_facebookvalg.gif (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/images/***_klubbsymbol.png (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/images/***_logo.png (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/js/***.js (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/js/jquery-2.1.1.min.js (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/js/jquery.flexslider.js (expiration not specified)
http://www.***.no/Files/Templates/Designs/***2015/js/jquery.mobile.custom.min.js (expiration not specified)


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Tom-Erik

You have 2 options. You can contact the hosting provider and make them set it up. Or if it is a custom solution you can set up expiration in web.config. See http://www.iis.net/configreference/system.webserver/staticcontent/clientcache and http://stackoverflow.com/questions/7221408/http-expire-headers-in-asp-net-with-web-config

BR Nicolai

 
Jens Jakob Vedel Kristensen
Reply

Hi Nicolai,

It would be great if it was possible to create Expiry headers for the individual DW-solution, regardless if it is running on a shared or an dedicated server.

The need for speed optimization is the same in both scenarios.

I am not very familiar with the server aspects involved in this matter, so maybe I am asking for the impossible here? But could it be possible to add these expiry headers in some way, either through the backend, or via an XML-file, or something?

 

 
Nicolai Høeg Pedersen
Reply

Hi Jens Jakob

The issue is how requests are handled by IIS. Requests for static files are handled by a static file handler in IIS - our code cannot reach that pipeline so that we can manipulate the headers runtime like we can for .ashx or .aspx files.

So web.config needs configuration settings related to the webserver - we could make them configurable, but since multiple solutions share web.config in a non custom environment, that would be an issue. It might be possible to do something with included config files, but it is not that simple.

The alternative would be sending static ressources through a pipeline we can reach by code, but that is a performance hit as well so not the best solution.

So you are not asking for the impossible, but something that is not that simple I'm affraid...

BR Nicolai

 

You must be logged in to post in the forum