1. I create an action controller that does the actual resizing of the image
a. This controller puts the thumbnail into a publicly accessible
directory with a predefined naming scheme
2. I create a route that mirrors this naming scheme and contains all of the
information that the controller will need to create the thumbnail (i.e
images/thumbnails/<media item ID>/<width>x<height>.jpg)
The first time a thumbnail is requested, it will be created by the action
controller. Every request thereafter for that thumbnail will go straight to
the image file that the action controller created, bypassing PHP entirely.
Raavi Raaj wrote:
>
> Hi,
>
> Performance wise which solution is better for resizing + caching + serving
> images
> All image requests are handled via...
> 1. Controller + action
> 2. Dedicated php script outside of the mvc (using htaccess to redirect
> relevant requests)
>
> I serve images in three sizes small, medium and large and the url for the
> images look like
> 1. Small = domain.com/images/s/news-x.xxxxxxxx-xxxx-xxxx.jpg
> 2. Medium = domain.com/images/m/news-x.xxxxxxxx-xxxx-xxxx.jpg
> etc.
>
> All images are stored in the "data/uploads/" folder outside of the
> public_html folder
> I look forward to your suggestions.
>
> *Why is performance important?*
> Cause I am on a shared host with limited server resources :)
>
> Also, if possible could someone share how they handle image serving
> through
> a script/mvc
>
> -R
>
> P.S. Some pages have requests to around 30+ images (thumbnails).
>
>
--
View this message in context: http://www.nabble.com/Image-resizing-performance-question-tp20993012p20995694.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论