2

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
1

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.

  • 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
4

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'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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