Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This bug was a major issue for my site: <a href="http://worldofsolitaire.com" rel="nofollow noreferrer">http://worldofsolitaire.com</a> </p> <p>I worked around it a long time ago by using a conditional rule in an .htaccess file that would disable ALL caching of images on the site for Firefox users. This was a horrible thing to need to do, but at the time I couldn't track down the bug within Firefox and having the site be slightly slower is better than showing duplicate/corrupted images.</p> <p>When I read in the linked bug that it was fixed in the latest Firefox releases, I changed the conditional on April 19th 2009 (yesterday) to only disable caching for Firefox 2 users.</p> <p>A few hours later I've received over 10 e-mails from Firefox 3 users (confirmed) that they were seeing duplicate images. So this issue is STILL a problem in Firefox 3.</p> <p>I decided to create a simple Linux test program that would allow me to check URL's to see if they are generating the same cache hash keys.</p> <p>To compile in any Linux system: g++ -o ffgenhash ffgenhash.cpp</p> <p>Here is the code (save to file ffgenhash.cpp)</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;stdlib.h&gt; #define ULONG_MAX 0xFFFFFFFF #define PR_ROTATE_LEFT32(a, bits) (((a) &lt;&lt; (bits)) | ((a) &gt;&gt; (32 - (bits)))) unsigned long ffgenhash(const char * key) { unsigned long h=0; for(const unsigned char * s = (unsigned char *) key; *s != '\0'; ++s) { h = PR_ROTATE_LEFT32(h, 4) ^ *s; } return (h==0 ? ULONG_MAX : h); } int main(int argc, char ** argv) { printf("%d\n", ffgenhash(argv[1])); return 0; } </code></pre> <p>As you can see, here are two real life URL's that generate the same cache hash key:</p> <pre><code>./ffgenhash "http://worldofsolitaire.com/decks/paris/5/12c.png" 1087949033 ./ffgenhash "http://worldofsolitaire.com/decks/paris/5/13s.png" 1087949033 </code></pre> <p>Since I pre-load these images in a Javascript loop, trying to use some sort of empty &lt;script&gt; tag workaround is not possible here.</p> <p>Indeed I think my only real solution is to modify the URL's for Firefox users in some way to generate a unique cache hash key. So that's the approach I'll use.</p> <p>By the way, I'm half tempted to create a Firebug addition that will check all resources loaded by a site and give a big error if two resources on the site share a common hash key so the developer is aware. It would be great to run sites like Google maps through this as I've seen weird things with those images over the past few years :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload