Replies: 13 comments 6 replies
-
It would be nice indeed if we can configure it somehow. That setting could be some kind of configuration table such as :
Of course the annoying part for Microsoft will be the implementation ^^ If you need an CRA example that has bunch of pictures (already converted in Webp to safe network load) with infinite scroll loading : https://jy95.github.io/games If I run report (with "https://jy95.github.io/?/games" as these tools doesn't like CRA redirection workaround) on : I can see that "Serve static assets with an efficient cache policy" is the main action |
Beta Was this translation helpful? Give feedback.
-
Since this question has been inactive for a while, are there any updates on this? |
Beta Was this translation helpful? Give feedback.
-
Not sure about the caching policy now, but I have a GitHub pages that cached a 404 not found for a directory --- in other words:
|
Beta Was this translation helpful? Give feedback.
-
I'd also love to see the ability to customise the cache values. For example, GTmetrix tells me: ![]() |
Beta Was this translation helpful? Give feedback.
-
You can setup the cache front the client side, with the javascript Cache API. https://developer.mozilla.org/fr/docs/Web/API/Cache It should work. |
Beta Was this translation helpful? Give feedback.
-
Any update on this would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
-
This would be a fantastic feature to add! If GitHub pages could natively support the CloudFlare "_headers" file or even configuration via the settings, this would make Pages a much more powerful too. A good use case for this is if you are bundling fonts. At the moment, one of the front-ends I have worked on ships with its own font files. For the sake of keeping things as simple as possible, I decided not to use a CDN and instead ship those files as a local copy via GitHub pages. It works fine.. but due to the short cache time its constantly re-loading on each visit. It would be fantastic to either set it to cache always with revalidation or to be able to at least specify a longer cache time. Otherwise, a CDN would probably be needed as the user experience is not fantastic. Anyway, just my 2 cent! |
Beta Was this translation helpful? Give feedback.
-
Came here from https://pagespeed.web.dev/analysis If I can setup caching policy, I would get 100% score! Would be nice to have this policy and make it possible for largest static website hosting platform to let its users to have excellent score! |
Beta Was this translation helpful? Give feedback.
-
Has this topic seen any change? |
Beta Was this translation helpful? Give feedback.
-
seriously! if we could at least increase caching time, it would save github lots of money on bandwidth! |
Beta Was this translation helpful? Give feedback.
-
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
There seems to be nothing but positives from implementing this:
It would be great to have the option to have a simple static file like the It may be worthwhile to go a JSON/YAML route similar to how Firebase Hosting sets it up: https://firebase.google.com/docs/hosting/full-config#headers "hosting": {
// ...
// Applies a CORS header for all font files
"headers": [ {
"source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers": [ {
"key": "Access-Control-Allow-Origin",
"value": "*"
} ]
} ]
} It's possible to keep the user interface light for this and make it an advanced option for users that want to tune the behavior. If the user clicks a button like |
Beta Was this translation helpful? Give feedback.
-
i would also say that github should auto-configure github pages (by default) so that pages that are unchanged for extended periods of time gradually get longer cache ages. perhaps something like this table below?
Now while this table example may not fit perfectly with most pages, you probably get the idea of "longer time unchanged = longer time cache age". Different types of content (HTML, CSS, JS, Images, Videos, etc.) will likely need to be configured differently too. |
Beta Was this translation helpful? Give feedback.
-
Original issue here.
The servers for GitHub pages set
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.Beta Was this translation helpful? Give feedback.
All reactions