lukeed / sirv

An optimized middleware & CLI application for serving static files~!
MIT License
1.07k stars 58 forks source link

Add some API to refresh / update the cache #142

Closed PlopTheReal closed 2 years ago

PlopTheReal commented 2 years ago

It is very likely for a CMS that the assets will be mostly dynamics. Having a mechanism to update the cache or sometimes refresh entierly would be really handy.

lukeed commented 2 years ago

In the CMS situation, it's unwise to actually cache hundreds/thousands of assets in memory anyway. Beyond a certain count of files, you should be using dev mode – or several sirv instances, some of which are dev: false (thus cached) but most of which are dev: true so that they continuously hit the filesystem for updates. This would require you separate assets by subdir