[San-Diego-pm] An old yet persistent problem

Joel Fentin joel at fentin.com
Mon Sep 27 09:21:36 PDT 2010


Al,

Thank you for getting back to me. Please see below.

On 9/26/2010 11:35 AM, Al Tobey wrote:
> On Sun, Sep 26, 2010 at 10:42 AM, Joel Fentin <joel at fentin.com
> <mailto:joel at fentin.com>> wrote:
>
>     The browser makers could make this easy but they won't.
>
>     I have needed this for years. Here is the current version of
>     the need:
>     After some .JPG files swap names, I want the user to reload
>     the page from the server. Not from the cache. Elsewise, the
>     pictures appear in the wrong places.
>
>     I've been rummaging Stack Overflow and in plenty of other
>     places, looking for advice. None of it works for me.
>
>     1. The most typical advice is along the lines of:
>     <meta http-equiv="Cache-Control" content="no-cache, no-store,
>     must-revalidate">
>     <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
>     <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
>     <META HTTP-EQUIV="Pragma-directive" CONTENT="no-cache">
>     <META HTTP-EQUIV="Cache-Directive" CONTENT="no-cache">
>     <META HTTP-EQUIV="Expires" CONTENT="0">
>     No combination of these works for me.
>
>     2. The one and only thing that works well is to press the F5
>     button after the page loads. I have not seen an example of
>     this in the Perl code.
>
>     3. Perhaps there is some javascript that would do the job. I
>     would need it to do something like: xxx.pl?ID=1234
>     <http://xxx.pl?ID=1234>. Not a link nor a button - but
>     executed in and at the end of the Perl script.
>
>     If the cure is to work in only one browser, I prefer Firefox.
>
>
> Have you tried Etags?

Until I got your email, I had never heard of Etags. Since then, I 
have been reading and reading. I still don't get it.

ITEMS:

+ In your example below, where does the 123456789 come from? Is it 
from within the jpg pulled out with Image::ExifTool?

+ Is the "v" a special browser variable or an HTML control name?

+ If the browser makers can enable the F5 button for the 
convenience of the users, why won't they give us (the programmers) 
the same convenience?

> http://developer.yahoo.com/performance/rules.html <- great stuff
> in there in general
>
> Maybe you can add a version string to the image URL and get most
> of what you want.   I haven't seen it used for images but it's
> used quite a bit for javascript.
>
> <img src="/images/foo.jpg?v=123456789"/>  This can even point at a
> regular file and Apache will eat the query.   If you change the
> version in your HTML, it'll bypass your browser cache and come
> back to the server even if the filename is the same - at least for
> <script> tags.
>
> That said, Etag headers per-image are probably what you really want.
>
> -Al

-- 
Joel Fentin       tel: 760-749-8863
Biz Website:      http://fentin.com
Personal Website: http://fentin.com/me


More information about the San-Diego-pm mailing list