F
F
Finom2012-04-10 23:50:49
JavaScript
Finom, 2012-04-10 23:50:49

"Manual" management of HTML5 cache

I would like to be able to call a function from JS that would add a specific file to the cache. Based on the articles, there is only one possibility: to use a manifest file. Is it possible to include this file using the DOM?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Zheltyakov, 2012-04-11
@VitaZheltyakov

You can dynamically connect the manifest file (to work) only using an iframe, but this method cannot be combined with regular caching due to a FF bug.
I use Application Cache for Opera, Safari and Chrome browsers, and for the rest I use the usual preloading of elements using JS.
An example of reloading images in JS:
function PreLoad(image) {
if (!(image in preload)) {
preload[image] = new Image();
preload[image].src = 'images/'+image;
}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question