the time of upload. I've put together a script that resizes an image
and caches it at the requested size. Then if that size is ever needed
again, it selects it directly from the cache directory. I've used this
method on dozens of projects.
Then i make my calls for images through my media.php script:
<img src="images/media.php?s=350&id=myImage.jpg" />
It resizes the image so the longest dimension is 350. If the file:
cache/myImage.350.jpg exists, the script serves it directly.
This method also has the benefit of providing a secure gateway for
your images. Email me directly if interested in the code.
Good luck,
Eddie
On Dec 13, 2008, at 2:35 PM, keith Pope wrote:
> If your images are public I would serve them from the public folder, I
> usually resize at time of upload rather than doing them on the fly per
> request.
>
> 2008/12/13 Raavi Raaj <raaviraaj77@gmail.com>:
>> 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).
>>
>
>
>
> --
> ----------------------------------------------------------------------
> [MuTe]
> ----------------------------------------------------------------------
>
没有评论:
发表评论