jump to navigation

Metatags and cache control better on server July 10, 2007

Posted by maxmil in : html,Java , trackback

In IE7 i have’nt been able to override the cache of an html page with metatags.<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="-1" />
It seems that the browser takes no notice of these meta-tags.

If you are serving pages dynamically (in my case the pages are generated from jsp’s) a way round this is to set the headers of the response in the server. IE does then take notice.<% response.setHeader("pragma", "no-cache"); %>
<% response.setHeader("cache-control", "no-cache"); %>
<% response.setHeader("expires", "0"); %>


no comments yet - be the first?