contao / core

Contao 3 → see contao/contao for Contao 4
GNU Lesser General Public License v3.0
492 stars 213 forks source link

Bypass cache setting for non images only #6211

Closed Ruudt closed 10 years ago

Ruudt commented 11 years ago

When developing extensions bypassCache has to be enabled, but when developing anything that features some images this makes loading pages quite slow because images are regenerated each pageload (perhaps I just need a faster computer).

Since it is rarely needed to have the images regenerated on every pageload this perhaps should be a separate setting bypassImageCache.

tristanlins commented 11 years ago

Bypass cache only bypass the internal cache, not the assets cache, afaik.

Ruudt commented 11 years ago

https://github.com/contao/core/blob/develop/system/modules/core/library/Contao/Image.php#L150

Now you do!

tristanlins commented 11 years ago

okay this is new for me, but good to know ;-)

Ruudt commented 11 years ago

I was thinking that perhaps bypassCache should be the master setting and then a subpalette of cache options would be available. Not sure how many settings make sense. But at least assets vs internal cache does.

tristanlins commented 11 years ago

:+1:

Zeromax commented 11 years ago

:+1:

leofeyer commented 11 years ago

Actually, it should depend on the debug mode, not the internal cache. The debug mode changes the content of the CSS files (assets) therefore it would be logic to also regenerate the images (also assets). The bypassCache option, however, relates to the internal cache, which means files in the system/cache folder.

Ruudt commented 11 years ago

debugMode currently does not affect assets/images, bypassCache does. CSS files do not use resized images. But if you mean changing this so debugMode handles that part then that probably solves my problem, but how does that help CSS files that (afaik) always point to the original (non cached) files anyway?

tristanlins commented 11 years ago

@leofeyer if we make the "bypass X" setting more granular, we could add more options like "bypass dca cache", "bypass languages cache", "bypass autoloader cache" and "bypass frontend cache", "bypass image cache", ... This would make debugging in live systems a little bit easier, without bypass all caches and extremely slow down the live instance.

aschempp commented 11 years ago

I have never ever had the need to bypass image cache but not the autoloader...

tristanlins commented 11 years ago

But I had to, when a specific function in a live system not work. At last I need exactly what you said, the image processing was failing and produce a lot of corrupt images. Bypass the image cache have make my life easier in this situation (I have to delete the images manually). In summary it was a problem with GD :D

Ruudt commented 11 years ago

I had the reverse. Image generation is fine. But 48 images + images in the layout resized each page; 6 seconds to load anything. Enabling caching means I have to flush dca cache all the time.

To be able to precisely define what cache gets disabled would help On Sep 23, 2013 3:03 PM, "Tristan Lins" notifications@github.com wrote:

But I had to, when a specific function in a live system not work. At last I need exactly what you said, the image processing was failing and produce a lot of corrupt images. Bypass the image cache have make my life easier in this situation (I have to delete the images manually). In summary it was a problem with GD :D

— Reply to this email directly or view it on GitHubhttps://github.com/contao/core/issues/6211#issuecomment-24917923 .

leofeyer commented 10 years ago

Fixed in c82e30c7cb2e205a5c2bc06e2fd47c473e54bc6b. It turned out we have merged the line from a pull request, however, the pull request in fact used debugMode instead of bypassCache :)