Search code examples
amazon-web-servicesamazon-cloudfront

Cloundfront gets locked on index.html


I have the following distribution. https://dhzcuvpl3uus.cloudfront.net

for the sake of similicity, i have 2 objects:

  • index.html
  • manifest.json

When I am accessing for the first time (after hard cache or icognito mode) the manifest.json (https://dhzcuvpl3uus.cloudfront.net/manifest.json) object, i can see the content.

However, after accessing the index.html object, i lose access to manifest json. It shows the index.html even when i am requesting the manifest.json object by the url.

It can be fixed with hard cache.

what is the reason with this behavior?


Solution

  • The reason is that your manifest is working.

    At your manifest you have

    "start_url": "./index.html"
    

    And in your index.html you have:

    <link rel="manifest" href="/manifest.json">
    

    So once index.html is called your browser caches that your "Web Application" start URL is ./index.html ...

    Even if you try to access -> https://dhzcuvpl3uus.cloudfront.net/shazam it will call what the browser has on cache from the manifest.json

    ./index.html
    

    Tl dr: Your manifest is working, and your browser is caching.