WEBcoast Logo

Deferred image processing for TYPO3 CMS

In one of my recent projects I tried to generate images with the <picture> tag and different image sources for different screensizes and pixel densities. This led to about 10 different image sources per included file, which dramatically increased page generation time for pages with unprocessed images. It happens from time to time, that you include new images or need to clear the processed images. The result would be unbelievable slow pages, because TYPO3 CMS applies image processing during page generation in the frontend.

I tried to find a solution to defer the image processing from the page generation to when the image is actually requested by the client (browser). As far as I found out, there was no extension, that provides this functionality. Therefor I created EXT:deferred_image_processing. The extension registeres an image processor, that is evaluated before the local image processor to kind of catch the image processing requests and queue them. When the client requests one of these images, the queue item is found based on the URL. Internally the local image processing is started to apply the requested processing rules. At the end, the image data of the scaled image is returned.

There is one small downside though. Because the images are scaled on the first request, loading an image could take a bit longer than if it was just returned by the webserver. In my tests this did not have a huge impact and was the lesser evil compared to the delayed page rendering.

The extension is available from TER or packagist.org.