Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Google page speed rank demands me to set an expiry date or a maximum age in the HTTP headers, by changing the "Expires" and "Cache-Control: max-age".

The site is hosted on a hosting company (not in my garage) on a windows platform. I tried by uploading a .htaccess file but they have IISPassword program that blocks it.

The question is how do I modify the HTTP headers?

when checking the current header this is what I get:
HTTP/1.1 304 Not Modified
Content-Location: http://pcgroup.co.il/Default.htm
Last-Modified: Wed, 14 Mar 2012 18:38:56 GMT
Accept-Ranges: bytes
Vary: Accept-Encoding
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Wed, 14 Mar 2012 19:16:43 GMT
share|improve this question
up vote 1 down vote accepted

Create a file called web.config.txt and then upload it to your server root. Then rename the file, removing .txt extension. You will then need to modify the file with the correct code.

share|improve this answer
Actually this answer helped realize that I can use the info that @toomanyairmiles wrote without having access to the server settings, only by editing the web.config. Thank you both! – BornToCode Jun 3 '12 at 21:20
an example to the web.config: <system.webServer><httpProtocol> <customHeaders> <add name="Content-Type" value="; charset=utf-8"/> <add name="Expires" value="Mon, 1 Apr 2013 15:30:00 UTC"/> </customHeaders> </httpProtocol> </system.webServer> – BornToCode Jan 4 '13 at 4:18

A .htaccess file works only on the Apache webserver, you're using Microsoft's IIS Webserver.

See 'Add Expires or Cache Control Header to static content in IIS'

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.