Support » Plugin: Simple Twitter Connect » [Plugin: Simple Twitter Connect] JavaScript Loading on Every Page

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42) Admin

    Yes, that is indeed the case, and it’s by design. Browsers do this pretty intelligent thing called “caching”, where they save the information from one page to the next. So it really doesn’t matter much if all the pages have the twitter javascript code, the code will be loaded from the browser cache.

    More to the point, the twitter code is linked directly to the twitter servers, so it’s loading from them, same as it loads for every other website on the internet that has the twitter code on it. So there’s a fairly good chance that the users browser already has the twitter javascript in its cache to start with.

    Not the initial loading shiv, mind you, which is different for every site, but the subsequent lazy-loaded code will be much the same and have the same URLs. Same thing happens with Facebook’s JS, it loads a short JS file which then loads like 10 others, all of which are basically the same from site to site.

    This is why single-page-testing tools and things like YSlow and such don’t tell the whole story. They’re only measuring the performance of one particular page load, you really have to see it from a whole-site standpoint.

    That is one great answer and that makes perfect sense. It would be interesting to see some analytics on how many people really do have it pre-cached before they get to our site. As an aside do you know of any way to detect if a cached version is being used (Client side JS library maybe)?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Simple Twitter Connect] JavaScript Loading on Every Page’ is closed to new replies.