Currently this module regenerates images and CSS files on every cache clear. That is bad for multiple reasons.
1) Cache clears happen on every cron run. That means a lot of wasted time regenerating stuff.
2) If cron is running from CLI rather than wget, there is no request domain name available. That means the URLs of the generated images are generated incorrectly, as simply http://default/files/generated_image_name.jpg.
The latter is of course the larger issue. Simply allowing image styles to generate images on-request (as is best practice) would be preferred, but doesn't solve the problem of the URLs being incorrect.
I'm not sure of the ideal solution here, but it is a problem to be addressed. My best thought is to lazy-generate the CSS, a la image styles, so that it's always generated in an HTTP context so always has a valid request to get information from. (Or rather, image styles have that information.)
Comments
Comment #1
Crell commentedComment #2
konsumer commented+1
Comment #3
acrollet commentedThe second concern is fixed by #1910798: Allow for relative URL generation
Comment #4
acrollet commentedThought about this a little more - it is true that the CSS is re-generated every time cache is cleared. However, images are not, because there is a file_exists check for the image before running image_style_create_derivative(). In an ideal world, we would only re-generate the CSS on cache clear if it absolutely needed it, but I doubt it's a huge hit. Wontfixing this issue, but I'm open to re-visiting if a patch is posted, or someone does some benchmarking and proves that this is a significant performance hit.
Comment #5
miroslavbanov commentedThis can be fixed by adding a
<style> tagin the theme override function.