Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Why send an 80kb 400x400 image scaled to 40x40 with IMG attributes when a real 40x40 one would be 4kb?

One possible reason is if the 400x400 image is expected to be viewed later. Why send 4kb 100 times and then 80kb 95 times when sending 80kb 100 times will do? In your example, this justification would only work if the larger image were requested about 95% of the time (though that would still win with protocol overhead) but, with different images, that ratio could be a lot lower. There is no substitute for traffic analysis.

Another reason might be because generating thumbnails on the fly is expensive in terms of both CPU and time. You might argue that one should then generate the smaller images ahead of time but that approach could be costly in terms of disk and, perhaps more importantly, maintenance issues. These problems could be compounded by the need for multiple thumbs of different sizes.

Having many ways to do things is so desirable because which of those ways is best usually depends on the problem at hand.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Re^2: Manipulating Images (height and width) by sauoq
in thread Manipulating Images (height and width) by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found