Reputation: 17761
Scenario: I make an update to a CSS file, push to the CDN, and need to change the version number in the query string to make sure that users' browsers download the latest copy
Here's the problem: all of my pages are behind Varnish, and the absolute URL of the CSS file is being pulled from memcached.
Do I need to expire the entire page just to trigger the update?
Upvotes: 2
Views: 184
Reputation: 5559
You need to expire the pages that refer to the 'old' versions of the css. If you are worried that expiring 'whole' pages is expensive, you can divide your pages in ESI processable fragments and only expire the CSS-containing HTML fragment.
Another (bit exotic) option is to use javascript. If you have a lot of cached pages, and they include a javascript resource that's updated more frequently than your cached web pages, have the javascript add the latest css url to the DOM.
Upvotes: 3