By default, payload sets the
cache-control
header to
public, max-age=0
on static assets.
1. Why not caching the JS/CSS/fonts/svg files since they could contain a hash in the filename to prevent cache issue for the user ?
2. Why does the
style.css
file doesn't contains any hash ?
@elliotyoyo This is a good idea for a feature enhancement. We use webpack which can definitly help with hashing. Are you interested in making a PR to Payload for this?
Tried to play with the webpack configuration, hashing the style file should be as easy as
filename: 'styles-[contenthash].css'
.
I would like to make sure everything works fine but I don't understand how I can test the build version ?
@dribbens Made PR
https://github.com/payloadcms/payload/pull/2500Star
Discord
online
Get help straight from the Payload team with an Enterprise License.