[Dojo-interest] Smart JavaScript Caching
Rob Kinyon
rob.kinyon at gmail.com
Fri Feb 9 19:17:59 MST 2007
We rename the file to some unique number. That way, we -guarantee-
that the file is the one that should be downloaded.
Rob
www.kayuda.com
On 2/9/07, Dylan Schiemann <mail at dylans.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Scott,
>
> It's definitely a solid best practice. We often use the last modified
> timestamp instead of a version number, with the same result.
>
> - -Dylan
>
> Scott O'Reilly wrote:
> > I'm not sure how many of you are using Dojo in production environments,
> > but I wanted to pass along a tip that has saved us a ton of user support
> > headaches.
> >
> >
> >
> > We tell the browser to cache the JavaScript files, but every time we
> > upgrade our web app the old files stay cached and it screws things up.
> > One solution that we've found is to stick the app version number into
> > the file's querystring which forces a fresh download every time the app
> > version number is incremented.
> >
> >
> >
> > |<script type="text/javascript"
> > src="js/dojo/dojo.js?redownloadToken=1.2.17"></script>|
> >
> >
> >
> > We're also doing some interesting stuff when the app is in development
> > mode to force a reload every time and to use an uncompressed version of
> > Dojo for debugging. The full writeup is here:
> >
> > http://www.spiderstrategies.com/blog/?p=12
> >
> >
> >
> > -Scott
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Dojo FAQ: http://dojo.jot.com/FAQ
> > Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> > Dojo-interest at dojotoolkit.org
> > http://dojotoolkit.org/mailman/listinfo/dojo-interest
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFzSgO8nLgh/JJsxERAsN+AJ9c/i+J3llyM2wF57g6T9ucgpqzgACffZRR
> CJFcZiKM8VRUWcoN3JygX78=
> =nB8D
> -----END PGP SIGNATURE-----
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
More information about the Dojo-interest
mailing list