Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Caching of payload files

default discord avatar
elliotyoyo2 years ago
2

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 ?

  • discord user avatar
    dribbens
    2 years ago
    @280062818890547200

    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?

  • default discord avatar
    elliotyoyo2 years ago

    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 ?



    @969226489549713438

    Made PR

    https://github.com/payloadcms/payload/pull/2500
Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.