Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asset cache time on Shopify servers

Tags:

shopify

When editing a custom .css.liquid file that is not automatically set up by Shopify and cannot be placed in a page (since it does not have access to Shopify's Liquid templating system), I find that it can take hours for the CDNs to start serving up the new version of said .css.liquid file.

In the future, how can I cut down on this waiting time? Currently, here's what I think is going on:

  1. Most asset urls have some number appended to them, like so: path/to/filename?270. It could be that this number is meant to represent last time file was served, version number, or some other flag to indicate to serve up the file. If so, then I can just create a template to grab this info myself (though I prefer not having to take an additional step.

  2. The CDN servers' cache times are high, and will not reissue a new representation of the file until the data in the cache has expired. If so, there's not much I can do about this.

Please let me know if it's one of the above situations, or if it's something else.

like image 397
Edwin Avatar asked Nov 13 '22 00:11

Edwin


1 Answers

I've had success with re-saving the layout file that calls the .css.liquid file.

For example: edit something then save it up to the server. And then edit it back again and save that back up to the server.

This seems to increment the query string on the path to the css file.

like image 154
ianneub Avatar answered Dec 30 '22 09:12

ianneub