getdave / Tanlinell

Boilerplate Wordpress theme for rapid development of new WP themes. Based on the great work of the _s ("Underscore") theme.
GNU General Public License v2.0
6 stars 2 forks source link

Enable filename based cache busting #250

Closed getdave closed 10 years ago

getdave commented 10 years ago

By default WP adds a query string to the end of all assets. This is for cache busting purposes. We haven't been using this correctly.

Basically many proxies will not cache requests that contain query strings. Therefore in order to cache static assets such as CSS and JS which we want to have a far future cache expiry we need to remove the query string.

However we need to retain the cache busting abilities else users will never see the updated asset files when we update.

To do this we need to do the following

  1. Update assets to remvoe query strings. This is achieved by setting null as the argument. See here
  2. Add Grunt task version as per MXVice. Add to run on watch tasks.
  3. Add Grunt "clean" task as per MXVice.
  4. Test