Repository navigation
fix(vercel): let browsers and Cloudflare cache docs images - #4927
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
brandyscarney
approved these changes
Dec 2, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Most requests to the docs aren't page views. On 12-02, two placeholder images drew ~9,440/min (
thumbnail.svg) and ~1,560/min (avatar.svg). Our code samples use their fullionicframework.comURL (85 and 143 files), so apps built from copied samples fetch them on every load.Vercel serves every docs file with
max-age=0, must-revalidate, so Cloudflare caches none of it and passes every request through. That volume trips Vercel's DDoS protection, which then shows the "Failed to verify your browser" page to all docs visitors.Changes
/docs/img/*withCache-Control: public, max-age=86400, so Cloudflare and browsers keep images for a dayHow to test
Run against this PR's preview URL:
curl -sI https://ionic-docs-git-cache-demo-images-ionic1.vercel.app/docs/img/demos/thumbnail.svg | grep -i cache-controlIt should print
cache-control: public, max-age=86400.`curl -sI https://ionic-docs-ionic1.vercel.app/docs/img/demos/thumbnail.svg | grep -i cache-control
On main's deployment,
https://ionic-docs-ionic1.vercel.app/docs/img/demos/thumbnail.svg, it printspublic, max-age=0, must-revalidate. Don't compare against ionicframework.com while it's challenged: it returns the challenge page, which isprivate, no-store.