Reputation: 349
Does a web browser cache files based on what is shown in the URL bar, or by where the file actually come from?
Consider the following two Cloud Front Distributions.
distro1.cloudfront.net
distro2.cloudfront.net
A CName record points www.foo.com to distro1.cloudfront.net.
If I change the CName to point to distro2.cloudfront.net.
Since the source is changing, but the address is not...
Will browsers notice the different source and request a new file or just load the cached version. (assuming they have a cached version)
Thank You!!
-C
Upvotes: 0
Views: 104
Reputation: 179364
A browser should not notice that the IP address is different and decide the locally-cached object needs to be refreshed. If it does notice... that is a broken implementation.
A web site can have many, many different IP addresses, all at the same time, all with the same content... and, conversely, a single IP address can have many, many different web sites behind it. Either way, the underlying IP address, and any intermediate targets of CNAMEs is an implementation detail that the browser has to remain unaware of for caching purposes.
Upvotes: 2