0

Caching YUI locally

What would would really be great is to be able to store and serve YUI locally via a simple service. Although at the moment this looks like it's might be possible to with PStore (although the site is down so I can try this at the moment), the addition of a service would be great... Just install the service and make a single call in JS to request a specific version of YUI, defaulting to the latest stable version if version is unspecified or incorrectly specified.

This could also easily be extended to other libraries including homegrown ones.

Thanks
Graham

by
3 Replies
  • QUOTE (CelloSounds @ Dec 1 2008, 02:43 PM) <{POST_SNAPBACK}>
    What would would really be great is to be able to store and serve YUI locally via a simple service. Although at the moment this looks like it's might be possible to with PStore (although the site is down so I can try this at the moment), the addition of a service would be great... Just install the service and make a single call in JS to request a specific version of YUI, defaulting to the latest stable version if version is unspecified or incorrectly specified.

    This could also easily be extended to other libraries including homegrown ones.

    Thanks
    Graham


    Hi again, Graham,

    A great idea. Here's the proposed API of the, say, LocalCache service:

    CODE
    BrowserPlus.LocalCache.get([ 
    'http://someapis.com/foo.js',
    'http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js'
    ], function (x) {
    // ...
    });

    The return value of the service would be a list of ephemeral localhost urls that can be used to access the specified resources. Those resources would then be served from local cache and would be outside of the browser's cache limits.

    For the YUI case, ideally someday the usage of BrowserPlus for resource acquisition would be abstracted from the developer by YUI, and the fallback (in the event BrowserPlus isn't installed) would be to attain the resources in the normal fashion.

    Essentially this optimization would be based on the claim that commonly used RESTful resources, like YUI javascript, are being pushed out of browser caches. It would be a creation of a two level cache on the end user's machine, the generic bucket which is the vanilla browser cache, then another layer which is opt-in by webpages would use additional space for specific long lived resources.

    Really it seems like lots and lots of analysis would be in order to determine how interesting this is in terms of end user performance benefits. I personally think this is interesting and worth exploring more... There are many issues that then need to be worked through, but I've said enough for now...

    So taking a step back, and a breath or two, does this proposal capture your original idea?

    very best & thanks for posting,
    lloyd
    0
  • hi Lloyd,

    Thanks for your suggestion, it would be great to have this feature. Here are some additional brainstormed thoughts just on the spur of the moment, please ignore if irrelevant :rlloyd
    0
  • In the meantime, YUI and other JS lib caching can be improved a couple ways, one is via Google's AJAX APIs
    http://googleajaxsearchapi.blogspot.com/20...gets-fresh.html

    Shared libraries for JS (really just improving lifetime in the host browser cache of that URI)
    0
  • This forum is locked.

    Recent Posts

    in Feature Ideas