Forums » Help & Troubleshooting



Components without a far-future expiration date

I'm optimizing a website and get the following from a GTMETRIX report.

There are 2 static components without a far-future expiration date.

- http://fonts.googleapis.com/css?family=Source+Sans+Pro

- http://in.getclicky.com/in.php?site_id=XXX&res=1024x845&lang=en&type=pageview&href=%2F&title=XXXX&mime=js&x=XXXXX

Is there anyway that click can add these? (I don't understand this stuff that much I'm just following recommendations so sorry if I'm being an idiot!).

I've managed to resolve this on those items I control with htacess.

Thanks

Posted Wed Apr 9 2014 2:30a by blobm***


Your first one, the font from Google, is not something Clicky can help you with.

The second one is for the Clicky tracking code, don't believe you want this file to be cached... Clicky can answer for sure.

Posted Wed Apr 9 2014 5:40a by ringo***


hi blobman,

you need to understand what the expiration date does: it speeds up your web site for your visitors by telling the browser not to download a page or component again until it expires. So the browser uses the cached copy it downloaded the first time until the expiration date, and then it will reload the page or component one more time and use that cached copy until it expires again. That prevents the browser from reaching out to the web server and pulling a fresh copy of something that hasn't changed and thereby speeds up the page load time.

Imagine a complex page template with a lot of static header graphics, menus, sidebars, etc that don't change which are framing the content in the middle that is different on each page. A blog would be a good example. Once the browser downloads the page template, the only thing that changes on each new page is the content of the blog post (and maybe ads which would be another case where you need to allow a fresh update with each new page). All the rest of the stuff around it took a relatively long time to load (compared to the blog post) and you could avoid incurring that download time as the visitor browses the blog by setting far-future expiration dates for all the static components. This way each new post comes up lightning fast using the cached copy of the static components which have not expired and the browser only pulls the new content when it renders the next page.

Now Clicky is intended to track each action your visitor takes on your website. When the browser reaches out to the clicky server, the clicky server logs the action and information passed to it and returns a 1 pixel graphic which is virtually invisible. If that link was set with a far-future expiration date, the browser would use a cached copy of the 1 pixel graphic but more importantly the interaction with the clicky server to log the action would not happen. It is important that this component expires immediately so it is downloaded every time as your visitor clicks from page to page on your web site, the browser fetches it again from the clicky server, and the the clicky server logs every action. If you were to force a far-future expiration date, then the clicky tracking would log the only first action a visitor took on your web site, and ignore all future actions until the expiration date. Probably not what you want.

For tracking tools like clicky, the developers go to great lengths to not impact page load time for the tracking code. Plus, if you wanted to you could force clicky to load the tracking code asynchronously. The asynchronous tracking code will still reload each time but the browser won't wait for it to load before it processes the next component. This would incur less delay in rendering the whole page but at the risk of missing the action if the visitor clicks away before the action was logged. Most websites don't need that level of optimization, but you can find the asynchronous tracking code on your site preferences / tracking code page if you wanted to look into it.

If you are having page speed problems, clicky is probably not the cause. I get from your question that you aren't necessarily having page speed problems, just trying to respond to recommendations from GTMETRIX tool on how to maximize page speed. Remember this is general advice from a tool without consideration of exceptions where you might want to reload the listed components every time instead of using cached copies that were previously downloaded. In the case of clicky, it is desirable for the tracking component to load fresh every time and avoid far-future expiration dates which would prevent it from tracking each action a visitor takes on your web site.

If you go tackle all the other stuff the GTMETRIX recommends except for clicky, then you are way more proactive than 90% of all webmasters and you will probably have a blazing fast web site. In the unlikely event that the clicky tracking code is noticeably slowing your site down, then consider implementing the asynchronous tracking code. Failing that, I would reach out to clicky tech support. They take pride in clicky performance and I will go out on a limb and tell you they would be quick to respond if you were noticing page load delays caused by clicky.

cheers,

Ed

Posted Wed Apr 9 2014 6:14a by edyod***


Great response, and I did wonder whether that might be the reason for not expiring stuff.

You've also alerted me to a possible reason that there is a really weird bug on the website, a case of me being overmilitant on gtmetric implementation.

I've already got the asyncronous script in the pages too.

thanks again.

Posted Wed Apr 9 2014 7:13a by blobm***


Yeah we intentionally set "in the past" expiration dates for calls to in.getclicky.com, to ensure they never get cached by any mechanisms. In addition, the "x" variable on the very end of the URL is a random number we tack on whenever we log data, as an additional cache-buster. Point being we never want calls to in.getclicky.com to be cached by anything, otherwise that traffic would never get logged :(

And 10 bonus points to edyodis for probably the longest technical post ever on the forusm.

Posted Thu Apr 10 2014 9:58p by Your Friendly Clicky Admin


+1

Posted Fri Apr 11 2014 2:14a by blobm***


You must be logged in to your account to post!