我尝试使用httpd.conf(Windows)中的以下configuration禁用我的GWT应用程序的caching,但不起作用:
<filesMatch ".*nocache.*"> FileETag None <IfModule headers_module> Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" </IfModule> </filesMatch>
但是我仍然看不到来自服务器的响应中的任何这些头文件。 任何想法? (headers_module被激活)
感谢托马斯的帮助。 我认为这个问题是因为mod_jk
apache并没有真正发送文件。 我发现这个线程帮了很多。 我只需要用LocationMatch
替换FilesMatch
:
<LocationMatch ".*nocache.*"> FileETag None <Ifmodulee headers_module> Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" </Ifmodulee> </LocationMatch>