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.


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.

  • what the hell is this nonsense...
    – Rotem
    Aug 9 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. Aug 10 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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