httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matus UHLAR - fantomas <>
Subject Re: [users@httpd] How to avoid caching on apache (with tomcat in back-end)?
Date Tue, 24 Mar 2009 09:03:13 GMT
On 23.03.09 16:12, Darius Rus wrote:
> I have a dynamic (JSP) page with a form that can be submitted that contains:
> response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
> response.setHeader("Pragma","no-store, no-cache, must-revalidate"); //HTTP 1.0

only no-cache is used in the Pragma: header, the others belong to
Cache-Control: header

> response.addHeader("Cache-Control", "post-check=0, pre-check=0");
> response.setDateHeader ("Expires", -1); //prevents caching at the proxy server
> I've added this to avoid caching, so that after the form is submitted
> and the user clicks on browser "back" button the form is not displayed
> from cache.

"Cache-Control: must-revalidate" with Expires: should be enough for this.

> I've checked if I have cache enabled on apache server and I don't, all
> cache related modules are not loaded:
> #LoadModule cache_module /usr/lib/apache2/modules/
> #LoadModule disk_cache_module /usr/lib/apache2/modules/
> #LoadModule file_cache_module /usr/lib/apache2/modules/
> #LoadModule mem_cache_module /usr/lib/apache2/modules/

These only affect caching on apache's side, the browser and intermediate
proxies still may cache the content themselves.
Matus UHLAR - fantomas, ;
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
My mind is like a steel trap - rusty and illegal in 37 states. 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message