Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Autocomplete Caching Basics

Expand Messages
  • Eric Miraglia
    Keith, You re right that AutoComplete s caching mechanism is focused on the XHR data sources. You re also right that your small 65KB dataset is a good
    Message 1 of 2 , Mar 30, 2007
    • 0 Attachment

      You're right that AutoComplete's caching mechanism is focused on the XHR data sources.  You're also right that your small 65KB dataset is a good candidate for a JS_Array data source rather than an XHR data source.  If you include that data as an external script file, and if your server is configured with gzip enabled and far-futures expires headers, you can expect that file to be cached.

      The assumption, then, is that the data doesn't change very much or that you'll version-stamp the filename so that when the data does change the user pulls in the new file version.

      Along these lines, we've done a bunch of research on cache usage that might be of interest --


      Eric Miraglia
      Yahoo! User Interface Library

      On Mar 29, 2007, at 9:54 PM, MrWump wrote:

      I need some help understanding caching and autocomplete.

      When the docs talk about caching, it's mostly to do with the remote /
      http request stuff, right? What I don't get is how long the cache
      lives for.. a session, or a page view?

      Let me put it a different way, and this shows my ignorance of
      javascript to a great extent. I'm creating a rails application, and I
      was going to use the http request method, but now that I look at it,
      that whole DB is only about 65k.

      Is there anything in autocomplete that would let me to create a big
      old array and benefit from the same kind of brower caching that caches
      css files? Like, can I have a file which just sets up the array, and
      is referenced from autocomplete many times over a users session - but
      because it's the same file, the data is pulled from a users local cache?

      Am I making sense.. Sorry, this is perhaps more of a noob js question
      than a YUI one ;-)?



    Your message has been successfully submitted and would be delivered to recipients shortly.