<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:blog.bcarlso.net,2005:/2007/10/19/tomcat-weak-etags-and-javascript-css-caching</id>
  <link rel="alternate" type="text/html" href="http://blog.bcarlso.net"/>
  <link rel="self" type="application/atom+xml" href="http://blog.bcarlso.net/2007/10/19/tomcat-weak-etags-and-javascript-css-caching.atom"/>
  <title>Till Death Do Us Part : Tomcat, Weak ETags, and JavaScript/CSS Caching</title>
  <subtitle type="html">Thoughts around my marriage to technology</subtitle>
  <updated>2009-10-25T17:23:10-07:00</updated>
  <generator uri="http://www.typosphere.org" version="4.x">Typo</generator>
  <entry>
    <id>tag:blog.bcarlso.net,2005:Comment/12</id>
    <published>2008-06-11T08:36:54-07:00</published>
    <updated>2009-10-25T17:23:10-07:00</updated>
    <link rel="alternate" type="text/html" href="http://blog.bcarlso.net/2007/10/19/tomcat-weak-etags-and-javascript-css-caching#comment-12"/>
    <author>
      <name>Patrik</name>
    </author>
    <title type="html">Comment on Tomcat, Weak ETags, and JavaScript/CSS Caching by Patrik</title>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <div xmlns="http://www.w3.org/1999/xhtml">
Interesting post! Which version of Tomcat are you running on? - I tried the code myself but there is no method called getAttributes() . At least none that doesn't take any arguments.        </div>
      </div>
    </content>
  </entry>
  <entry>
    <id>tag:blog.bcarlso.net,2005:Comment/13</id>
    <published>2008-06-15T08:49:27-07:00</published>
    <updated>2009-10-25T17:23:10-07:00</updated>
    <link rel="alternate" type="text/html" href="http://blog.bcarlso.net/2007/10/19/tomcat-weak-etags-and-javascript-css-caching#comment-13"/>
    <author>
      <name>Brandon</name>
    </author>
    <title type="html">Comment on Tomcat, Weak ETags, and JavaScript/CSS Caching by Brandon</title>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <div xmlns="http://www.w3.org/1999/xhtml">
Patrik,

We were running TC 5.x.        </div>
      </div>
    </content>
  </entry>
  <entry>
    <id>tag:blog.bcarlso.net,2005:Comment/19</id>
    <published>2009-01-05T14:24:22-07:00</published>
    <updated>2009-10-25T17:23:10-07:00</updated>
    <link rel="alternate" type="text/html" href="http://blog.bcarlso.net/2007/10/19/tomcat-weak-etags-and-javascript-css-caching#comment-19"/>
    <author>
      <name>ptys</name>
    </author>
    <title type="html">Comment on Tomcat, Weak ETags, and JavaScript/CSS Caching by ptys</title>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <div xmlns="http://www.w3.org/1999/xhtml">
...A "strong entity tag" MAY be shared by two entities of a resource only if they are equivalent by octet equality....

The way the etag is calculated in your example represents a weak etag, and what tomcat does by default. It's very likely for two entirely different files to be of same size and modified time.

You need to use some digest algorithm to claim a strong etag.        </div>
      </div>
    </content>
  </entry>
  <entry>
    <id>tag:blog.bcarlso.net,2005:Comment/20</id>
    <published>2009-01-05T16:46:14-07:00</published>
    <updated>2009-10-25T17:23:10-07:00</updated>
    <link rel="alternate" type="text/html" href="http://blog.bcarlso.net/2007/10/19/tomcat-weak-etags-and-javascript-css-caching#comment-20"/>
    <author>
      <name>Brandon</name>
    </author>
    <title type="html">Comment on Tomcat, Weak ETags, and JavaScript/CSS Caching by Brandon</title>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <div xmlns="http://www.w3.org/1999/xhtml">
@ptys Good point.

From the same spec: "Entity tags are used for comparing two or more entities from the same requested resource".
<blockquote>
It's very likely for two entirely different files
to be of same size and modified time.
</blockquote>

True. But two entirely different files to be of the same size and modified time for a given resource? I think that's a bit less likely. I chose to usurp TC's ETag implementation as I deemed it "Good Enough".
<br />

Thanks for the clarification.
        </div>
      </div>
    </content>
  </entry>
</feed>
