Very strange caching problem with python script run from apache

tinnews at isbd.co.uk tinnews at isbd.co.uk
Fri Dec 28 19:09:53 EST 2007


tinnews at isbd.co.uk wrote:
> I'm running a python script via the apache ExtFilterDefine directive,
> it works basically as expected *except* that when I change the script
> apache/firefox continue to run the old version of the python script
> until I remove the script completely and then replace it.
> 
> I.e. my script is called tl2html.py, if I change it to (say) add
> several lines of output the added lines don't appear on firefox.
> I can restart firefox and I can restart apache and *still* it runs the
> old version of tl2html.py.  If I 'mv tl2html.py fred' and then
> redisplay the page I get an error (because the script isn't there) and
> if I then 'mv fred tl2html.py' the new version of the script is run
> and I get my expected extra lines.
> 
> This makes dubugging/development *exceedingly* difficult!
> 
> Where is this python being cached?
> 
It's OK, I have found the problem, it's Firefox's cache.

Since the file/URL *doesn't* change when I change the filter
(tl2html.py) Firefox simply redisplays its cached copy of the page. It
makes no difference if you restart Firefox or restart apache the cache
is still there and Firefox will use it.

Simple workaround is to hold Shift down when reloading the page, this
forces Firefox to get a new copy even if it thinks it hasn't changed.

Phew, that took a long time to work out!  :-)

-- 
Chris Green



More information about the Python-list mailing list