Add a development mode to allow changes to be picked up even when CSS/JS aggregation is enabled

Created on 7 January 2010, almost 15 years ago
Updated 20 August 2023, about 1 year ago

With all the talk of IEs 31 stylesheets, and CSS aggregation "on vs. off" I just had a bit of a brainwave.

The problem with having aggregation on is that you need to remember to manually clear the cache every time a file changes. While you can turn aggregation off for development (IE 31 limit issue notwithstanding) it is easy to forget to clear the cache when pushing theme changes (or module updates that don't require database changes) to a production site, and especially likely to flummox new users.

The filename for the aggregated file is generated from an md5 of the serialized array containing the filenames and inline/external code that was input to the aggregation.

It occurred to me that all we need to do is add the modification time for each file to it's array element and our problem will be solved, because the md5 will change any time a file mtime is updated. The attached patch does just this - apply the patch, enable aggregation and every single CSS or JS edit should be immediately functional. Why didn't we think of this sooner?! :)

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
Asset libraryΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States Owen Barton

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • JavaScript

    Affects the content, performance, or handling of Javascript.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024