Asset Cleanup and other tips to reduce CPU load

Note: I am posting this in Informal since it is a bit too low quality for a community post.

I had noticed that my site loads pretty slow and I just didn’t know why. I also saw that a lot of people are suspended because of high CPU load. I did some digging around and found out some tips to reduce CPU load

  1. Avoid these plugins: 73 WordPress Plugins that slow down websites from High CPU. These plugins are resource hungry and use up CPU very easily. Alternatives include Rank Math SEO for SEO, Gutenberg for Page Builders, WPForms for contact forms, Ithemes Security for Security, UpdraftPlus for Backups etc. The only exception for me is Elementor Page Builder since some features can’t be found anywhere else. Another exception for people is Jetpack if YOU NEED ALL OF ITS FEATURES (since installing the plugins one by one uses more resources), otherwise it is a bloated plugin.

  2. Use Asset Cleanup to disable useless features and scripts. Some plugins like Elementor and Contact Form 7 put unnecessary scripts on your site. To get started first install the Asset Cleanup Plugin (I know it is another plugin but it is extremely lightweight and makes your site faster more than slower) and enable test mode in the settings. Now you an play around with the settings seeing if your WordPress site functions as before (don’t worry since it is in test mode the changes are only shown to you).

  3. Use a CDN. CDN take the strain off your servers and make your website faster for international users. I currently use 2 CDNs: Cloudflare and Amazon Cloudfront. Cloudflare is very easy and straight forward to configure, look at this community guide: A Full Guide To Cloudflare. I also use Amazon Cloudfront for my images which is free up to 5K views per month. Go to optimole.com and create an account, copy your API key. Then go to your WordPress dashboard and install the Optimole Plugin and paste your API key. Optimole not only provides a CDN but also compresses your images by 90% without loosing the quality.

  4. Block Cloudflare bots: How to protect your website that is on Cloudflare plus Logs

Done. Now this is how fast my website loaded with these optimizations:

P.S. My main website isn’t hosted on Infinityfree (I use infinityfree to help people and to host my 2nd website robertzou.ml) but another free host (3001.host). However my website used to load in 3.5 seconds and now is 774ms.

5 Likes

BTW, you can also use Optimole on static sites or non WordPress sites. Create an account, keep note of the API key. Then paste this code in the head tags: Random-Code/Optimole Code at main · robertzo/Random-Code · GitHub

Make sure to replace your key with your API key. You can also change the settigs to your liking.

Then on every image instead of using this attribute:

<img src="your image url"/>

Use this

<img data-opt-src="your image url" width="800" height="600" />