Pre-cache site as user visits

Posted by strager on Stack Overflow See other posts from Stack Overflow or by strager
Published on 2010-05-16T01:37:10Z Indexed on 2010/05/16 1:40 UTC
Read the original article Hit count: 224

Filed under:
|

I am making a static site which is 'forced' to be cached via Cache-control, etc.

When a user visits my site, I want the browser to crawl my site, caching pages, so when the user navigates to a page, the load is almost instant.

(I do not need a recursive crawl, as that will probably happen as the user navigates between pages. I just need to crawl the links on the current page, and of course not re-caching a page which has already been cached.)

(Also, I am not changing pages using Ajax-like techniques. These are essentially normal flat HTML files with normal links.)

How can I do this pre-caching using Javascript? (I am using jQuery.)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about caching