Optimizing the WP task scheduler

Certain WP tasks need to be executed in the future, either one time or on an ongoing basis. These tasks include things like publishing a scheduled post  (one-time) and checking for WP, plugin, and theme updates (ongoing). WordPress includes a built-in component called wp-cron.php that triggers execution of these scheduled tasks. But not always when I would want or expect it. It runs on every page or post load. This works fine on a site with a regular stream of moderate traffic.  But …

Optimizing the WP task scheduler Read more Optimizing the WP task scheduler

Website speed tests

It’s Sunday, too hot to be outside, and I’m kinda bored. I think just for fun I’ll test-drive a few of the website speed checkers that clutter the web. Speed matters. WP, like any CMS, is handicapped from the start. My browser asks a flat html site for a page, the site says “OK, here you go.” By comparison, WP says “OK, sure. Hang around a bit. I’ll query and pull a bunch of stuff from the database, fetch some images, some CSS and Javascript files, and build that page for you.” So, I do what I can – or at least what I think makes sense – to make my sites speedy.

Website speed tests

Read more Website speed tests

Optimizing the WP Database

Optimizing the WP databaseEvery time I edit a post or page, WP keeps a copy of the old version in my database. It is a great feature, handy when I mess up and need to revert to the previous version. But once my post or page is final, I have no use for the prior revisions. By default, WP keeps all the old versions, forever, and they can add up over time. I recently checked one of my sites and was surprised to find 3,566 useless old pages cluttering up my database. A large, cluttered database slows my site, as the server takes longer to retrieve information.

Read more Optimizing the WP Database

Custom 404 Error Page

In another post I present a case for using a short, simple text string to report 403-Forbidden errors. For Not Found errors, I want to serve a friendly helpful 404 error page that fits reasonably well with the look and feel of my site. But I still want to limit resource use to the extent practical, otherwise serving a lot of 404 pages could slow my site or even bring it down.

Read more Custom 404 Error Page

CloudFlare Speed Settings

miscellaneous CloudFlare speed settingsIn another post I cover a CloudFlare page rule for blazing site speed. This post discusses miscellaneous CloudFlare speed settings. CloudFlare, even at the free tier, offers a plethora of speed and security settings that seem daunting at first. Most of them work fine using the default setting, and I can adjust settings at my own pace as I am able to make time to learn and optimize.

Read more CloudFlare Speed Settings

Caching Plugin

LiteSpeed cache logoI chose my web host carefully. My sites are hosted on a LiteSpeed web server, so I am able to use the remarkable free LiteSpeed Cache (LSC) plugin. LSC provides much more than just lightning-fast server-side caching. In also includes a suite of optimization tools such as: Database optimization; Image optimization – which seems to be equal to or better than the paid/premium versions of competing plugins; Connection to CloudFlare so I can put CF in development mode or purge the CF cache; and Miscellaneous settings like ‘Remove query strings from static resources’.

Using my two favorite website speed checkers, WebPageTest.org and GiftOfSpeed.com

Read more Caching Plugin

CloudFlare page rule for blazing site speed

CloudFlare page rule for blazing site speedCloudFlare, even the free tier, improves my site speed and security – so much so that I use it for all my sites. The default settings boost site speed by global distributed caching of static content. Static content, by CloudFlare’s definition, excludes HTML. This makes sense for dynamic sites with frequent new posts and user comments. For my sites like this one, that have less frequent new posts and do not allow user comments or other dynamic content, I can dramatically increase site speed using a page rule.

Read more CloudFlare page rule for blazing site speed

403 Text String

If my site gets attacked, it could serve up a lot of 403-Forbidden error pages, which would use a lot of resources, slowing my site or even bringing it down. For 404-Not Found errors, I want to serve a friendly helpful page that fits in with the look and feel of my site. Legitimate visitors should rarely if ever encounter a 403-Forbidden error though, so I prefer to politely limit resource use to the extent practical.  My solution is a custom 403 text string, using the following line at the beginning of my .htaccess file:

ErrorDocument 403 "403: Sorry, not permitted."

Read more 403 Text String