Caching Static Assets in Github Pages

134 Views Asked by At

I am trying to cache static assets like images for my website in github pages - so that they are not requested again and again.

I've noticed in some other questions that github pages by default add Cache-Control to max-age=600

So I switched to removing local references and using s3 based url's with a max age set of large value - and referencing those links instead of relative urls

enter image description here

-> But I saw that cache-control is getting set to no-cache in the request headers -> is it because of this that the image is getting requested again and again ?

enter image description here

I've tried preloading the images and all that via javascript - but it's not helping and the image is getting requested again - and not getting cached at all.

I am not able to make at what layer - javascript, AWS or Github pages has the issue.

0

There are 0 best solutions below