5

Why caching an application prevent Cors request?

I have an example, two html page exactly Identical except the second line :

index.html link

<!DOCTYPE html>
<html manifest="main.appcache">

index2.html link

<!DOCTYPE html>
<html>

Why the one without manifest is working fine and the one with manifest works only the first time and stop working when the application is cached? (press F5 several times)

I tested with Firefox, Chrome and IE.

Thomas
  • 5,603
  • 5
  • 32
  • 48
  • And if you save on your desktop ... it works! – Thomas Jun 05 '15 at 10:44
  • What does CORS have to do with this, are you actually doing any cross-domain calls ? – adeneo Jun 05 '15 at 10:50
  • 2
    Did you try to update your appcache with NETWORK section, which allows requests? Try with simple NETWORK *. Details here http://www.html5rocks.com/en/tutorials/appcache/beginner/. Otherwise if your FastFlicker is not under CACHE section, it won't be loaded, and cache returns 404, which means that resource isnt cached – Andrey Jun 05 '15 at 11:04

1 Answers1

3

According to this article

NETWORK: Files listed in this section may come from the network if they aren't in the cache, otherwise the network isn't used, even if the user is online. You can white-list specific URLs here, or simply "*", which allows all URLs. Most sites need "*".

So behaviour you've described is appropriate, because your appcache manifest doesn't contain NETWORK section.

Update: request that fails - isn't CORS - because domain, protocol and port are the same.

Oleg
  • 22,300
  • 9
  • 68
  • 84
Andrey
  • 4,020
  • 21
  • 35