Autoresize images on the fly

In admin panel use TinyMCE and users are mostly loaded large pictures. Is it possible for the issuance of the text on the fly to compress.
That is, given a variable $text, which contains text plus pictures.
Is there a way to automatically parse the images and resize them before delivery to the customer?
October 8th 19 at 00:36
1 answer
October 8th 19 at 00:38
First picture you can limit in size when it is displayed using CSS (max-width), the second — for example nginx has a module for transforming images on the fly (ngx_http_image_filter_module) — but the right decision, of course — resize images when they are loaded on your server.
The right solution to resize images when showing it to the first who asked, and the rest to give the already reduced copy, ideally, if overcome the simultaneous querying of multiple people of the same images, which has no sarisozen. - aniya.Kertzmann65 commented on October 8th 19 at 00:41
Another problem is the method ""resize" on demand", when it dumped the cache of thumbnails and thousands of users begin to request pictures and server is very much to think about until they generate all thumbnails. - Jules56 commented on October 8th 19 at 00:44
The transformation of images on demand with subsequent packing into the cache can be easily implemented on nginx, but the busy-locks from him as far as I remember is still there... - Velva_Wym commented on October 8th 19 at 00:47
"but busy-locks from him as far as I remember is still there..."
Wrong. nginx.org/r/proxy_cache_lock/ru - Ignatius.Fadel34 commented on October 8th 19 at 00:50
Oh, that's very good news for me as I missed the appearance of this Directive in nginx! - Velva_Wym commented on October 8th 19 at 00:53

Find more questions by tags ImagesPHP