GitHub Pages – Caching Assets in Website Served from GitHub Pages

cacheconfigurationgithubgithub-pages

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.

Best Answer

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.