Make XF faster? Google Page Speed..


Well-known member
The biggest part of the Page Speed suggestions there is to Leverage Browser Caching... which really is something you should be doing at your server level, not the application level.

I use this (in Apache config) for serving static content:

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=5184000, public"
It's assuming of course you have the Header module enabled for Apache. Essentially all that does is instruct the user's web browser to not even bother checking if the file/page has changed until 60 days from now for files with the listed extensions.


Formerly CyclingTribe
I use a second domain for images and just change the URL in the style settings. A sort of home-grown mini-CDN :)


Does XF already offer some kind of support for CDN? Specifically, is it possible to define alternative absolute URLs for static content, including style images, avatars, etc.? With vB (3.8x), I had to do some small hacks and tweaks in order to make it work.
jQuery is via CDN, config.php supports CDN, and certain elements are stored in the file system for better caching option, and styles are using css more than images. While images can easily be pointed to cdn.* urls, rather than relative path. Other things such as js and css are minified. Search queries are cached, there's PHP code being used in a smart way to improve caching, and options to tell xenforo that caching is enabled, stuff like that all helps bigger boards get the most out of it by offloading to remote servers, browser cache, and internal memory. And general i/o


Formerly CyclingTribe
An easy way to speed up the delivery of static images in XF is to create a subdomain - say, that points to the same physical location as your XF install.

Change the image URL in the ACP settings to include your new subdomain ( - and then browsers can download images at the sane time as other content.

Shaun :D