Re: How to avoid caching on apache (with tomcat in back-end)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/mod_cache.so
> #LoadModule disk_cache_module /usr/lib/apache2/modules/mod_disk_cache.so
> #LoadModule file_cache_module /usr/lib/apache2/modules/mod_file_cache.so
> #LoadModule mem_cache_module /usr/lib/apache2/modules/mod_mem_cache.so

These only affect caching on apache's side, the browser and intermediate
proxies still may cache the content themselves.
-- 
Matus UHLAR - fantomas, uhlar@xxxxxxxxxxx ; http://www.fantomas.sk/
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:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux