Forum Moderators: martinibuster
Now, a fair chunk of code on every page comes from Google AdSense, the Google Search tool and - to a lesser degree - the Google Analytics code. Is there a way to host all three scripts centrally? If so, this would be tremendously useful to decrease loading times and traffic, as the code is the same on essentially all pages of my site and could be saved in the cache of most browsers.
Thanks for your advice!
W.
I just implemented to deliver my javascript compressed.
This is to optimize page load time.
I thought also to deliver the html pages compressed,
but this is not possible, because I insert the AdSense code by SSI.
What the SSI does, could also do a javascript.
This would be an additional speed up of the load time.
Now
load html page uncompressed and after SSI is performed
load AdSense javascripts
load javascript from search box
load own compressed javascript
load Google Analytics
What would speed up the load time
load compressed html page
load own compressed javascript (including AdSense code, javascript for search box)
load AdSense javascripts
load Google Analytics
16166 bytes html
13100 bytes AdSense code, AdSense search box, Analytics code removed
(it's assumed this would be inserted by the javascript)
3755 bytes Gun Zip compressed
The javascript would be a little bit longer, but this does not matter, because I load the javascript at the end of the page. Rendering the page can be started before.
Also, the code transfered to the javascript is good compressable.
OK, caught up with some very general information from self-HTML; question: If I include external HTML-snippets using an SSI, do I have to rename my widget.htm files into widget.shtml files or does that depend on my server (which is as I understand it)?
No! Just write in Your .htaccess
AddType text/x-server-parsed-html htm
If you have any problems getting it to work, the Apache forum [webmasterworld.com] is a great resource.