0

My page references a lot of PDF's. If the user loses connection to the Internet or their network, which unfortunately seems to happen quite a bit for our users in the middle of nowhere, I would still like them to be able to access the PDF's.

Using the Application Cache mostly works, except that it also caches the current page itself, and I can't figure out how to get it not to do that. The page itself changes frequently so I don't want it to cache. I know I can find out if it has changed, but that just means I have to refresh the page after they're already using it, which is not ideal.

So is there any way to NOT have the current page cache, but have everything else in my manifest file be cached?

I tried several different things without success. I added an iframe, which did seem to cache the PDFs, but when I went offline my current page did not access them from the cache (because the browser didn't know to grab it from the cache I would guess, I just know it didn't work). I also tried adding the current page to the NETWORK section of the manifest, so it wouldn't be cached, but it didn't work (it was still cached).

Am I missing something? Is there a better alternative for what I want?

Jesse Sierks
  • 2,258
  • 3
  • 19
  • 30

1 Answers1

0

It works without the "download" attribute on the anchor tag.

If anyone else has the same problem, the iframe solution does work (where you add a hidden iframe to the page, and the iframe is pointed to a page that has a manifest file for everything you need). It just doesn't work if you have a download attribute on your anchor tag.

That's about 3 hours I'll never get back...

Jesse Sierks
  • 2,258
  • 3
  • 19
  • 30