When css or js aggregation is enabled, you can force Drupal to recreate a new file with drupal_clear_css_cache(). However, if the browser has cached the file, a user may not see this new file for days. The only time a new aggregation file name is created is if a new resource (css or js) file is added to the page. So if you enable a new module, this works great. But if you are updating an existing module or theme, with changed css and changed html, but if the included file names themself have not changed, you have no way of forcing the browser to get the changes.

This patch adds a version variable, which can be set by a contrib module or in settings.php. The value can be incremented when pushing out changes to css/js that require a browser flush.

Feel free to change the version to 8.x. We're using this patch on an active project, and I know it applies against 7.x.

CommentFileSizeAuthor
css-js-browser-clear.patch971 bytesdouggreen

Comments

Status: Needs review » Needs work

The last submitted patch, css-js-browser-clear.patch, failed testing.

pasqualle’s picture

Status: Needs work » Closed (fixed)

I think this issue was fixed, as clearing the cache will create a new filename for aggregated css and js.