Document cache-control best practice

Open Beginner friendly
#20,064 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Active
Domain
documentation

Research direction

Start by reading docs/guide/static-deploy.html and the referenced Vite docs/public/_headers example. Check how the static deployment guidance currently describes hosting, then document the cache-control best practice and verify the new guidance is accurate and clear for deployers.

Written by the indexing model from the issue text.

Description

documentation
Documentation is
  • Missing
  • Outdated
  • Confusing
  • Not sure?
Explain in Detail

There is a best practice around Vite hosting:

https://github.com/vitejs/vite/blob/1fe07d3716012992dd7b2e78d8380add0b606a97/docs/public/_headers#L1-L3

Your Suggestion for Changes

I believe the docs should cover it in https://vite.dev/guide/static-deploy.html.

Next.js kind of does it, but not really: https://nextjs.org/docs/app/guides/self-hosting#automatic-caching. I guess it's not in their best interest to document this (for Vercel).

Reproduction

No response

Steps to reproduce

No response

Dominant language
TypeScript
Stars
82.9k
Forks
8.8k
Avg merge
2d 1h
Merged PRs (30d)
58

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vitejs/vite

All issues in vitejs/vite

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.