faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 4 people (100%) answered Yes
Recently 4 of 4 people (100%) answered Yes

Entry

How can a client see if a .js library file has been updated before downloading the entire file

Apr 6th, 2008 19:18
ha mo, Jean-Bernard Valentaten, Mark Szlazak,


I'll simply assume that client means browser.
This is one thing that a js programmer has no access to. It's part of
the htt-protocol. When the client has a website cached, it will not ask
the webserver for the whole document (assuming that no hard-reload was
performed by the user). Instead it will simply send the webserver a
request telling him which version of the files included in the website
and asking to confirm whether the files are up-to-date or not. This
request includes any html-document and any js-file (called libraries in
programmer slang). Not included are applet classes.
Since this could result in a security issue, js has no access to the
request.
Usually the .js files are reloaded if they have been changed in any way
(even if the timestamp is the same but the filesize varies).
Further information on this topic can be found at:
http://www.w3.org/Protocols/
Jean
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com