Hi,

On May 14, 4:04 pm, kstubs <kst...@gmail.com> wrote:
> This might be off-topic, but we are a pretty smart group here, so hoping to
> get some feedback.  Simple question, how do you distribute new javascript to
> the client?  How do you guarantee that they are either informed to refresh
> (hard-refresh) or that the script is updated automatically?  
>
> Karl..

The gold standard is to change the URL of the JavaScript file loaded
by the HTML. That way, you can use long caching times on your
JavaScript files without worrying about out-of-date clients, provided
your main HTML file has a short caching time (which is usually
necessary, so that changes to the main file get reflected on the
client right away). The same applies for CSS and any other additional
resource you want cached where possible.

Your best bet for that is to actually change the path, *not* use a
query string. That sounds like a maintenance nightmare, but I haven't
found it to be yet. And if you have a "build" step in your web
application (combining various JavaScript files, minifying them,
etc.), you can automate it to a large extent.

This article on caching is very helpful:
http://www.mnot.net/cache_docs/

HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to