Arquivos Statics

Asked

Viewed 25 times

0

Does anyone know how to use the files statics to improve site performance and speed?

Like the great ecoomerces use:

static1.netshoes.net/resources/lind/netshoes/lindd.min.js
static1.netshoes.net/3470.1.1/assets/css-min/theme-common/structure.css
http://static1.netshoes.net/Produtos/88/N03-0046-188/N03-0046-188_zoom1.jpg?resize=74:74

They use in images, scripts and css.

Does anyone know the right way to use this technique?

1 answer

0

First you need to know why there is performance improvement when using subdominio.site.com.

I believe the advantages are:

  1. CDN:

    The static.site.com is on another server, probably a CDN, specific to distribute this type of static content, the client will connect to the nearest server.

    Whereas the www.site.com is still processed by slow PHP for example.

  2. Avoids unnecessary cookie and header:

    Static files do not bind to a cookie in normal situations. If you have 500 bytes of cookies stored throughout the domain and have 10 static contents that need to be loaded, the customer will send 5000 additional bytes without any reason to do so.

    Now, if such 500 bytes of cookie are restricted to www.site.com it will not be sent when you get the static.site.com/js.js, that will save sending 5000 bytes of information without need.

    This is even part of "Best Practices for Speeding Up Your Web Site".


To gain some performance using sub.dominio.com you need to set cookies for only the main site, not including the subdomain, in addition you can hire some CDN service for it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.