Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why caching HTML5 page prevent doing Cors request?

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.

like image 585
Thomas Avatar asked Oct 19 '22 10:10

Thomas


1 Answers

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.

like image 90
Andrey Avatar answered Oct 28 '22 21:10

Andrey