I don't know, you know or don't know, but
1. While styles will not load - the page will not be displayed.
2. While the script that you are monitoring does not load (and does not run) - the page will not be displayed further
3.From paragraph 2, it follows that at one time only one script is loaded (and executed).
* But depending on the spelling, the second script may also be loaded (but not executed) simultaneously with the first ... but
4. One browser at a time holds only two (or four?) Connections to the same host.
Ie, on average, for downloading 6 scripts, the browser will make 6 requests to the server one by one.
It is generally not to refer to pictures, it seems like 4 pictures are being dragged at the same time.
BUT NOT MORE!
What to do?
It turns out that the standard page with
1. one css file
2. one js file
3. a pair of js framework files (AND THIS IS A PROTOTYPE! WITH AN ASULOUS!)
waits an average of 1-2 seconds on the “fetch” of these files. And only then drawn.
')
Yes, half the downloads look like aki “If-Match || If-Modifited "and processed relatively quickly
Some files are not requested at all (built-in Min-Max Age)
And all the unloved IE generally loves not to ask, even if necessary (and sits like a fool with the old versions)
In general, it was an introductory article for people to like ...
So to solve these problems (which came to me after reading
habrahabr.ru/blog/AJAX/16489.html )
I took the skriptik described in the article and the fry walked over it
the script is available hereSo the script can work like the original as an option.
add to .htaccess
RewriteRule (. * \. Css) combine.php? Type = css & files = $ 1 [QSA, L]
RewriteRule (. * \. Js) combine.php? Type = javascript & files = $ 1 [QSA, L]
and the second branch of
combine.php worksAnd ... we get only minimized jsmin scripts compressed together and sent to you in a suppressed encoding, exactly like in the original article
Or ... (here it is finally innovation)
In your HEADER (which, hopefully. Generated by php), we write
link link = "stylesheet" type = "text / css" href = "= combine_makeref (" css ", $ HEADERcssfile)"
or scary line
Quote:
script language = "JavaScript" src = "? = combine_makeref (" javascript "," scripts / positioning.js, ~ brouser.js, ~ scripts.js, ~ site.js, sc ripts / aculous / lib / prototype.js, scripts / aculous / src / builder.js, ~ effects.js, ~ dragdrop.js, ~ controls.js, ~ slider.js ")" / script
(the size of the original TARGET line - 204 kb, the size minimized by jsmin - 133kb, the size of compressed 31kb)
In general, we call combine_makeref and at the output we get some name. Which changes when files change (they are unique for a set of files and the time they change (and in general this is a simple E-Tag))
and this Expires file somewhere in a year.
And one person will ship it once! (In the original version, the update script was checked every time)
When accessing a file, he chooses the best compression option and gives it to you.
(add to .htaccess)
RewriteRule (. * \. Cssf) combine.php? Type = css & fetch = $ 1 [QSA, L]
RewriteRule (. * \. Jsf) combine.php? Type = javascript & fetch = $ 1 [QSA, L]
Well - already naaamnogo better than the original, but some people may ask: "Is not it cool to give statitka through php?"
Sometimes it's too cool ... so there is a last "best" option - use combine_staticref instead of combine_makeref
She at the stage of issuing the header will determine the compression option and give a static link to the file ...
Give it later with gnixes and other pribluda without calling the php code once again ...
Wow, I have already signed up.
Well, in general, I wait Kamentov.
again
combine.phpkernel.php