Tips for serving static files faster like JavaScripts, CSS and images

I would like to get some advice from our SO users about serving static files on a website - like JavaScript, CSS, images and flash files - Faster. Any helpful tips?

+3
source share
3 answers

The best advice I can give you is to buy the Steve Sites Book of High-Performance Websites that is Full of Simple Tips Regarding still images: use a content delivery network (CDN), which means: just put the static content on another server, on another ( optional) domain, and you have the best performance you can get for static content.

Advantages: no cookies are sent back and forth (this explains a lot of overhead!), No other HTTP overhead, good timeouts, high performance when using an external CDN and your own server becomes much less traffic. There are many commercial (like Amazon S3), but also free CDN providers.

, :

. StackOverflow - -, YSlow, .

+2

- CDN - .

, .. gfx.yoursite.com, . cookie .

CSS, .

, CSS base 64. DNS . , , . , , base64, .:)

+1

Yahoo http://developer.yahoo.com/yslow/ http://developer.yahoo.com/performance/rules.html. :

  • Use CDN for static files (and disable cookies in the CDN domain)
  • Make sure image sizes are optimized.
  • Minimize your js files
  • Put SCRIPT tags at the bottom of your HTML and use the defer = attribute where possible (this speeds up the page loading by the browser)
+1
source

Source: https://habr.com/ru/post/1761284/


All Articles