开发者

TimThumb vs Saving Thumbnails

开发者 https://www.devze.com 2023-01-04 19:58 出处:网络
Just a quick question: I\'m working on revamping a script that serves vehicle inventory to users. The site receives thousands of hits per month with many pageviews per visitor.

Just a quick question:

I'm working on revamping a script that serves vehicle inventory to users. The site receives thousands of hits per month with many pageviews per visitor.

My question is this:

I am going to have 7 images for each vehicle in the new system. 1 Main Product Photo 6 Interior Extra Photos

The 6 extras will be viewed as a thumbnail, with the ability to load the full image in a lightbox.

Now, to the question:

Should I use TimThumb (or similar) to resize the images to Thumbs on the fly, OR should I create a thumb directory and save a thumbna开发者_运维知识库il for each image as it is added to the server?

I use TimThumb for the main image, and it works quite well, but I'm debating which is easier on the server for the other 6 images.

Thanks!


it might not differ while the load is low, but rebuilding thumbs on request is quite resuorce consuming. if server load matters, you should save thumbnails.

there are two ways to do this: - generate all thumbs on image upload - generate thumbs on first request and save them


The easiest on the server is to use javascript on the client side. Its a little slower loading for the user if there are a lot of images being served but if there are less than 10 it should be okay. Look into using jQuery and CJ Object Scaler http://plugins.jquery.com/project/cj_object_scaler

0

精彩评论

暂无评论...
验证码 换一张
取 消