On 22/06/2013 03:33, Jacky Tian wrote:
I've got an app that serves galleries of user-uploaded photos, some of
which can be quite large in size. I've been serving scaled thumbnails
for most templates, but I need a higher resolutions for a detail page.
These images will still be smaller than the size of original image, and
I'm wondering if it's better practice to dynamically resize them
server-side based on the width of the viewport, or to just serve the
full-size images and scale with CSS?

Thanks
-Jacky Tian

Personally what I would do is the following:

When a user uploads an image create three copies of the image. A thumbnail, a normal sized version and a slightly larger version. This will leave you with 4 image files for every upload (thumbnail, normal, slightly larger and original) that way you can just serve the image files using a fast web server without having to do any server side processing on retrieval. Nginx is built for this sort of thing and is what I would recommend to serve all static content.

If you need to do any scaling on retrieval at a later date due to changes in how you want things to appear that you didn't necessarily consider when you implemented the system do it client side so that you don't waste server resources.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to