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

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

 



Hi,

I have an issue related to caching on apache server (my setup is
Apache/2.2.11 (Win32) in front of tomcat/6.0.18 using mod_jk/1.2.27)

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
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.

When I'm accessing this page directly from tomcat (bypassing apache
server) I get the correct behavior, the page is retrieved from the
server when "back" button is pressed, however when I'm accessing the
page through apache a cached version is displayed.

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

Any suggestions why I have this behavior? And how to solve the issue?

Thanks in advance,
Darius

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