Currently, our site stores 2/3 of the fixed image sizes. They are created at boot time and distributed through our CDN. However, we need to implement a more flexible solution, we have mobile and tablet applications in development, requiring many different sizes. Our proposed solution is to create a PHP script that can accept an image identifier (id / type / url etc) and size restrictions. The script can then create the image on the fly and cache it next time.
Is this a valid solution?
Also at the moment, CDN protects our web server from significant load. Is there a way to incorporate CDN into this process as soon as the image is created once? The only way I can do this is to return the script the URL of the image resource, but then the client needs to make 2 HTTP requests. Redirection may be faster, but isn't that a bad practice for speed?
source
share