The function ctools_css_cache() provides a convenient way to cache generated css to files.
But used carelessly also provides an easy way to fill up the ctools/css cache directory with thousands of identical files.

The function takes the generated css, creates an md5-hash as file name and stores the file to the ctools/css directory – renaming when it already exists.
As the md5-hash for the file name is based on the contents of the file to be cached, I think its safe to assume that two files with the same file name are identical and the file can be replaced or discarded. Either way it's better as to flood the disk with useless files.

Comments

sanduhrs’s picture

Status: Active » Needs review
StatusFileSize
new976 bytes

Status: Needs review » Needs work

The last submitted patch, 1: 2220917-ctools-css-cache-flood.patch, failed testing.

sanduhrs’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev

Don't know whether to put this in D8 or D7 queue.
It's actually an issue in a D7 Setup, so...

sanduhrs’s picture

Status: Needs work » Needs review
sanduhrs’s picture

StatusFileSize
new981 bytes

Better to replace, than to throw an error.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

I've been using this and no problems to speak of, thanks @sanduhrs

jennypanighetti’s picture

Is this patch NOT in the latest ctools-1.7 release?

joelpittet’s picture

It is not in a release or branch yet, no commit message.

  • japerry committed 2a8fe17 on 7.x-1.x authored by sanduhrs
    Issue #2220917 by sanduhrs: Ctools css cache creates thousands of files
    
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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