I am using a jQuery preloader for my images and I was wondering if it is possible to check if a page is already cached in a users browser before running the loader, is this possible?
The plugin runs on dom load with a function
$(document).ready(function () {
$("body").queryLoader2();
});
Could I write something like:
$(document).ready(function () {
if (!page_cached) {
$("body").queryLoader2();
}
else {
//do nothing
return false;
}
});
Appreciate your responses, thanks.
You could do a head request via ajax and if it returns 304 instead of 200, it would mean its there in the cache. Something in javascript would be like:
Hope it helps