javascript - Pre-cache site as user visits -


I am creating a static site that 'code' to the cache-control etc.

When a user goes to my site, I want the browser to crawl their site, caching pages, so when the user goes to a page, the load will be almost instantly is.

(I do not need an iterative crawl because it probably navigates between the pages. I need to crawl the link on the current page, and of course it should not be cached again. Which has already been cached.)

(Also, I'm not changing pages using techniques like Ajax. This is essentially a simple flat HTML file Not like.)

I could do it pre-caching using JavaScript? (I am using jQuery.)

  $ Ajax setup ({cache: true, type: 'received'}); $ ('A'). Each (function () ($ {.ajax ({url: $ (this) .attr ('href')})}}  

but I'm not sure that your browser is XmlHttpRequest The page will cache for more use without using.


Comments