if (!file_exists($csstidy_file_path))
The above code doesn't appear to be an effective way to detect if CSSTidy has already parsed the stylesheet.

A better option might be to detect when the drupal_build_css_cache function is called.

Then we can remove the code bits that detect if optimize CSS is enabled in the option because drupal_build_css_cache should only run when it is enable. Two birds, one stone.

We would just need to add a line of code to the install file to clear the cache when CSSTidy is installed.

Comments

philbar’s picture

Why this is bad:

  • Users cannot properly cache CSS for future visits because the file name keeps changing every time an admin uses the site.
  • Administration tasks take longer because of the unnecessary process of CSSTidy is running on every page load
ianchan’s picture

subscribe

philbar’s picture

Status: Active » Fixed

I did some testing on this issue on a dev server and the recent changes I made seem to have resolved the issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.