Recent
:: This post is secret saomateus.org
5 hrs ago
:: RIFAS
6 hrs ago
:: RIFAS
7 hrs ago
:: yoooo
10 hrs ago
:: aaadd
11 hrs ago
:: anonymous
13 hrs ago
:: aaa
13 hrs ago
:: This post is secret nox
15 hrs ago
:: This post is secret looser
16 hrs ago
:: anonymous
17 hrs ago
:: anonymous
17 hrs ago
:: anonymous
17 hrs ago
:: anonymous
17 hrs ago
:: anonymous
18 hrs ago
:: Whatup
18 hrs ago
rss 2.0 feed

Make New Post
Posts: 19094

Syntax:       Wrapping:  

   #3359 Posted by 2ge 2007-10-04 17:01:56
Formated by GeSHi
  1. Hi,
  2.  
  3. there is an easy way to speed up page load,
  4. and decrease server load at the same time.
  5.  
  6. In theory:
  7. Since most of u'r pages uses small images,
  8. the server has to answer many http requests.
  9. To minimize this effect put several images in one larger,
  10. and use it via css background-image,
  11. positioned to show only the needed part,
  12. and setting backgroundrepeat to no.
  13.  
  14. In praxis:
  15. All the flags could be in one img.
  16. Assuming the following things:
  17. -the first 3 flags in the img are: eng, ger, hun
  18. -they are next to each other
  19. -the width of one flag is 20px
  20. -the height of one flag is 10px;
  21. -the name of the big image is all_flags.png
  22. u can show the flags like this:
  23.  
  24. in the html file:
  25. <div class="flag" style="background-position:0px 0px"></div> english
  26. <div class="flag" style="background-position:-20px 0px"></div> german
  27. <div class="flag" style="background-position:-40px 0px"></div> hungarian
  28.  
  29. in the css file:
  30. div.flag {
  31. width: 10px;
  32. height: 10px;
  33. background-image: url('all_flags.png');
  34. background-repeat: no;
  35. }
  36.  
  37. This way, the number of http request for the flags will be only 1
  38. instead of a lot,
  39. and the network traffic will also be less, since one file has only one header.
  40. Please implement this technique, to speed up the page load.
  41. It's good for the server, it's good for the user.
  42.  
  43. Have a nice day.
  44.  
  45. nb000
Parsed in 0.01409817 seconds
::  Inline view Inline view ::  Email this post Email  ::  Print Print   

:: Download   Download Text File3359.txt   Download Gziped text File3359.txt.gz   Download HTML File3359.html   Download PDF File3359.pdf
:: Print into    Print into HTML FileHTML document   Print into PDF FilePDF document

:: Make Diff

:: Erase Post

* Code:

To highlight particular lines, prefix each line with @@


Description:


Secret key (for later deletion)
Syntax:     


comments (0)


Copyright © 2006 Openpastebin