staticallyio / statically

The CDN for developers.
https://statically.io
MIT License
585 stars 91 forks source link

How to force caching of new version of file #68

Closed warudin closed 4 years ago

warudin commented 4 years ago

Hi,

I made some changes in a .css file, updated a query-var with the version of the file from 1.0.0 to 1.0.1. However, Statically doesn't seem to pick this up and still serves the old .css file.

I'd think that a query var with the new version of the file would do the trick, but this doesn't seem to work. How can we force Statically to cache the new file?

Iquaridys commented 4 years ago

9 days but no answer, this site no develop anymore?

fransallen commented 4 years ago

Hi @warudin,

Sorry for the late reply. I hope you are well.

?ver= should do the trick on /sites/. It will fetch the same content to its origin.

For example: https://cdn.statically.io/sites/example.com/statically.js?ver=1 -> https://example.com/statically.js?ver=1 https://cdn.statically.io/sites/example.com/statically.js?ver=2 -> https://example.com/statically.js?ver=2 and so on.

If that doesn't work, use ?dev=1, this will only cache content for 5 minutes (use if you change content regularly).


Hi @Iquaridys's, glad you asked.

This site is actively developed, please refer to our Twitter @staticallyio instead to get the latest updates. Actually, we are currently making Docs and WP plugin v0.5, which will have more improvements for both (includes a deeper explanation of Cache-Control for @warudin's question). And is expected to be ready in 2 weeks. So please stay tuned.

It's important to know that we might move the bug tracker into a support portal or community forum because we want info to be useful for anyone and easily found on the website. So, in the meantime, just in case if GitHub Issue doesn't work, please use @staticallyio or support@statically.io instead.

Thanks, Frans

warudin commented 4 years ago

It seems like the problem was with combining css files, where I ended up losing a version number. Therefore statically.io didn't update the file.

fransallen commented 4 years ago

Combined JS/CSS files usually have a different file name, so CDN will cache the new version of the file. However, you can use ?dev=1 at the end of the URL for a shorter Cache-Control.