Tag: Site Speed

Clear W3 Total Cache by URL From the Admin Bar or Dashboard

When recently working on a WordPress website that generated pages from an API that aren’t stored in the main site database, I discovered that the W3 Total Cache admin bar link to clear the current page’s cache didn’t work.

The ‘Purge Current Page’ link in the Performance menu item works by passing the current post ID to a function that clears the cache by an ID. Since this only works for single posts, it also doesn’t work on post archives and term listing pages.

So I wrote a small plugin to clear the current page’s cache by its URL.

Continue reading “Clear W3 Total Cache by URL From the Admin Bar or Dashboard” ››

Forcing W3 Total Cache to Clear Parent Term Listing Pages on Post Save

In the page caching settings of W3 Total Cache there is an option to flush the ‘Post Terms Pages’ when saving or updating a post. This clears the listing pages for any terms that the post has been added to, but it doesn’t clear the listing pages of any parent terms that aren’t checked, even though the post can still show on those pages.

The following code uses WordPress filters to detect a change in a post and then invalidate the cache of any parent term listing pages whether they have been checked or not.

Continue reading “Forcing W3 Total Cache to Clear Parent Term Listing Pages on Post Save” ››

Standard URLS Called by Websites for DNS Prefetching

There are many articles out there on how DNS prefetching works so I will keep it brief.

It works by adding a link to the head of your web page with a relationship of ‘dns-prefetch’ and the url of a domain which holds assets needed for the page to load. That could be a cdn for the site, a social plugin or anything else.

Without prefetching, a browser will render the page top to bottom and when it gets to an asset which needs to be loaded from another domain it performs a dns lookup to find the location of the host and then downloads the assets. By adding prefetching links we are letting the browser know that these domains will be used before the assets are requested. Browsers can then loook up the hosts whilst rendering the rest of the page, cutting out this step when the assets are needed leding to a shorter download time.

This process is non-blocking and will only be performed when possible. For example, on a small page requesting an asset from another site high in the head of the document, it’s likely that the asset will be loaded before there is a chance to prefetch the dns.

The point of this article is to list domains used by common services for easy future reference.

Continue reading “Standard URLS Called by Websites for DNS Prefetching” ››

A New Solution to FOUT (Flash of unformatted text)

Adobe recently released their ‘blank font’. It is essentially a font which contains no glyphs and is basically a css hack to stop the flash of unformatted text when using webfonts.

I wrote a long time ago about how to cache the font files when using @fontface. That method can be used in conjunction with this to create the best user experiance for your site.

Continue reading “A New Solution to FOUT (Flash of unformatted text)” ››

Are CDN’s Always a Good Idea?

At first a content delivery network seems like a great idea, but is it possible that it can actually be detrimental to your sites speed? Lets find out.

Continue reading “Are CDN’s Always a Good Idea?” ››

Stripping Joomla 3

So Joomla 3 has been around for a while now and seems stable enough that you can use it for production sites without having to check up on it everyday to see if anything new has broken. And with a new site comes a new template. As always, I wanted it to be fast loading, so I set out to investigate what it is that joomla is inserting into my site.

Continue reading “Stripping Joomla 3” ››

Enable KeepAlive on Godaddy VPS

Another red warning light when running google page speed or yslow that is quite easy to sort out if you are running your own server.

First you need to know how to login through SSH as root user which you can do by reading this post.

And you need an editor installed to be able to edit the right file to enable the apache keepalive feature, which you can read about in this post.

(all links open in a new window so don’t be afraid!).

So here we go….

Continue reading “Enable KeepAlive on Godaddy VPS” ››

Set Expires Headers in .htaccess

Set Expires Headers in .htaccess to speed up page load times

If you use the firebug pagespeed addon or yslow you will be used to seeing the warning ‘Add Expires Headers’

This can be quite simple to fix by adding the following lines at the bottom of your .htaccess file.

Continue reading “Set Expires Headers in .htaccess” ››

Google Pagespeed for Firefox 4

Although not on the official page speed site, Google have actually released a version of pagespeed that runs on Firefox 4.

Why it’s not on the site I have no idea, I would imagine it would have something to do with pushing developers towards chrome.

Anyway, the link is here:

Continue reading “Google Pagespeed for Firefox 4” ››

Compress Favicon with Htaccess

Add MIME type and Expires Header to Favicon

Add these lines to your .htaccess file to speed up favicon loading, as specified by the Yahoo Yslow documentation.

Continue reading “Compress Favicon with Htaccess” ››