• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Is it possible to turn off ETag headers in Tomcat 6.0.20?

 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,

I wrote some stuff with servlet filters to get full control over caching effects for static vs. dynamic content in a Java web application. Everything seems to work fine right now except for this nasty ETag headers. Tomcat simply overrides existing ETag headers with its own weak ETags. That's definitely not what I want.

This seems to be a known issue with Tomcat and the only useful hint I found on how to solve this issue is to comment out the corresponding parts in the source code of Tomcat's default servlet. This is definitely also not what I want. Is there really no alternative way to configure Tomcat not to produce its own ETag headers? At least you can set a system property to prevent automatic insertion of an Expires header but I found nothing similar for ETags. Any help would be appreciated!!!

And YES, I know there are better ways to control caching of static contents, for example with Apache as a reverse proxy. But it's a requirement that it should work THIS way

Thanks in advance!
Marco
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marco, have you seen this article by Brandon Carlson, http://www.bcarlso.net/2007/10/19/tomcat-weak-etags-and-javascript-css-caching.html

Definitely worth a look!
 
author
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Marco,

you can configure tomcat 7 filter to cache static content
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic