Is it worth having static resources in a separate domain / server?

I am currently working on improving grails website quality and following the many best practices that I have found on the Internet, I currently need to make a decision between the two solutions before refactoring my code

  • Solution 1 : export all my static resources (js, css, images) to a separate domain and server (as has already been done by the SO command - see here ).

  • Solution 2 : just save my resources into my WAR file and configure apache on both the reverse proxy / caching , so that incoming requests / images, / css, / js etc. all are cached by apache.

What do you recommend and what are the pros and cons ?

PS: As for solution 1, do you have any web hosting providers specializing in static content?

Thank.

+3
source share
4 answers

You should only do this if you have profiled and determined that the latency caused by the browser in the download queue is a major factor in the performance of your site. If static resources load in a few milliseconds, but the HTML itself takes 3 seconds to load after the server got into the database ... then improving those few ms will not do much.

+1

- . , YSlow, .

. , , , . , images.yourdomain.com flash.yourdomain.com. , .

2 1, .. . , # 2, , .

, , , .

+1

, ui-performance grails. , - .

, , , , - .

+1

, /. , . IE 8 2 . 40 , 2 . .

CNAME DNS, .

Google PageSpeed ​​ .

0

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


All Articles