[Twisted-web] .js File caching behavior on different browsers

Phil Mayers p.mayers at imperial.ac.uk
Tue Sep 16 03:49:44 EDT 2008


>> Athena effectively does this automatically.  If JavaScript source files
>> are changing but the browser isn't requesting the new versions, then
>> there's a bug somewhere that needs to be fixed.
> 
> If JScript code is brought to the page via the javaScript classvar
> class LP(athena.Livepage):
>   javaScript = ('scripts/somescripts.js, 'scripts/otherscripts.js')
> 
> I end up with a static path to the scripts and they cling to Firefox.
> 
> How would you suggest to bring in additional (foreign, third party) 
> libraries?
> 
> Do I have to use the naming kludge or is there a better way.

The correct way is to set the HTTP headers appropriately. I presume 
/scripts is a static.File - it would be nice generally if static.File 
had a way to set the Cache-Control values



More information about the Twisted-web mailing list