.htaccess impact on site speed

I’m a big fan of the 6G firewall, from Jeff Starr of Perishable Press. It lives in my .htaccess file, and does a great job of protecting my site against a wide variety of malicious requests, bad bots, spam referrers, and other attacks. It adds 76 lines to my .htaccess file, some of them filled with long regular expressions. WordPress and Litespeed Cache also add chunks to my .htaccess file. And, .htaccess being exceptionally flexible and useful, I add other stuff as well.

htaccess impact on site speed

Read more .htaccess impact on site speed

Website speed tests – Part 2

Awhile back I bemoaned the very inconsistent results I get from online website speed checkers. Not just inconsistency from checker to checker, but also from the same checker at different times. I test-drove a few of the checkers and …

In summary, results are all over the damn place. My site’s speed grade is A, B+, B, or C. Load time is less than or second, or over 4 seconds. Also, there seems to be no correlation between grade and actual speed. Pingdom gives me a ‘C’ with less than a second load time, Uptrends gives me an ‘A’ with a 4.4 second load time.

Furthermore, if I use the same 10 checkers again, I will get different – sometimes wildly divergent – results from the same checker at different times.

Read more Website speed tests – Part 2

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