4 Replies Latest reply: Jun 20, 2014 2:13 PM by jyeager11 RSS

    Is it possible to downsize a large image on the server side (before serving it to the user)?

    jyeager11 Community Member

      One of the banes of my existence is resizing the same image several times because of the various contexts it appears in. For example, the main image in an article will appear bigger than it will on the index page, where many article teasers are placed. Then there's the image that goes in the Facebook "share" og. Then there's... you get the idea.

       

      Same image, different contexts, lots of Photoshop resizing, lots of files to keep track of... but I save on bandwidth.

       

      On the flip side, I can target the same (large) image and simply downsize via traditional HTML (width/height) on the browser end, but that will mean downloading a file that is 50-75% larger than what is actually needed. If the front page teaser displays a 1280px image at 500px, that's a huge (and potentially costly) waste of bandwidth.

       

      HOWEVER...

       

      If I could do the same thing on the SERVER side... in other words, tell the server to take only the pixels it needs from the (large) image and serve only THOSE to the end user... then the same image could be used in each and every context, and only the necessary bandwidth is used.

       

      Is this do-able? If so, what is the process formally called, and where would I begin to learn how to do it?

       

      Thanks!