ES Modules: suggestions for improvement
Wes Garland
wes at page.ca
Wed Jun 27 15:30:07 PDT 2012
On 27 June 2012 17:40, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
> What request do you send to ask for multiple modules?
We send a request like
/methods/modules?root=pathto/mystuff&id=/sha256&id=/auth/password
The client canonicalizes each CommonJS dependency to its full (canonical)
path and tells the server where the module system root is. The server then
examines each module last modification time, comparing against the
Last-Modified-Since header. Dependent modules are likewise examined
recursively. If any module is newer, all of the modules are sent,
otherwise, an HTTP 304 response is returned and the browser reads all
modules from its cache.
> And does this work for the non-cached situation (that is,
> how did the client get to the place where 304 was the right thing --
> by doing multiple requests previously?)?
>
Precisely.
This pattern is obviously more useful for some sites than others. But I
think it's interesting enough to mention.
Wes
--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120627/0e1beade/attachment-0001.html>
More information about the es-discuss
mailing list