httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darius Rus <>
Subject [users@httpd] How to avoid caching on apache (with tomcat in back-end)?
Date Mon, 23 Mar 2009 14:12:45 GMT

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/
#LoadModule disk_cache_module /usr/lib/apache2/modules/
#LoadModule file_cache_module /usr/lib/apache2/modules/
#LoadModule mem_cache_module /usr/lib/apache2/modules/

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

Thanks in advance,

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