34

The server for GitHub pages (including mine) sets CacheControl: max-age=600. It means the cache is set to last only for ten minutes, which is undesirable.

Is it possible to control this value and to set also only-if-cached status?

I know that there is no direct access to the .htaccess file or an equivalent, but I am looking for indirect access via some sort of settings or confirmation, or proof that it is impossible.

enter image description here

Note: this question is not a duplicate of Caching assets in Github pages (github.io) which answers whether Github pages have any caching at all.

1 Answer 1

44

Officially confirmed to be impossible.

Answer from GitHub support:

Thanks for reaching out to GitHub Support about using GitHub Pages

We set the following Cache-Control header for all GitHub Pages content:

Cache-Control: max-age=600

This header is the same for all assets on all sites on our Pages service, and we don't currently provide a way to alter the value.

I hope that this answers your questions.

5
  • 1
    what the hell is this nonsense...
    – Rotem
    Commented Aug 9, 2021 at 12:11
  • @Rotem You can try contacting them, maybe it changed or they will change it if enough people will ask. But AFAIK main recent change is removal of ability to contact employees. Commented Aug 10, 2021 at 8:36
  • @reducingactivity is there a feature request we can vote on? Or any recommended way to request this change? Commented Feb 13, 2022 at 16:07
  • @MominBinShahid I am not aware about Microsoft having some place where feedback about GitHub can be send and would be treated seriously. Commented Feb 13, 2022 at 17:15
  • Thanks, @reducingactivity, will update here if anything similar is introduced in future 🤞 Commented Feb 13, 2022 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.