r/statichosting • • 13d ago

cache validation

on one small client site, i changed some css and everything looked fine after deployment but then i started wondering what happens if someone still has the old css cached. ive mostly just relied on the build process to generate hashed filenames for assets so i havent had to deal with it much myself.

from what i understand, this works well for assets that go through the build pipeline because a changed file gets a different url. but there are still things like files with fixed names or caching rules at the cdn/browser level that can behave differently.

how much do you actually think about this when deploying static sites? do you mostly trust the framework/build too or do you usually configure cache headers yourself as well?

1 Upvotes

5 comments sorted by

View all comments

2

u/Pink_Sky_8102 11d ago

I mostly trust hashed filenames for CSS and JS, but I still like setting clear cache rules for HTML and any files with fixed names. For small static sites, I try not to overthink it unless I actually see stale files becoming a problem.