The performance of WordPress is a crucial factor for the success of your blog. Slowly blog is the enemy for visitors. So, it always needs to improve the performance to the top priority of modern optimization.
WordPress is a content management system (CMS) that written in PHP, and MySQL as its database management system so it uses a database as its brain for storing posts, pages, users, links, comments, menus, information, settings of themes and plugins, post content, metadata and user data, and a whole lot more, and all forms of textual and even the encrypted data. Almost everything is stored in the database. Without the database, there’s nothing works on WordPress. It’s like without a brain!
The optimized database runs faster than the unoptimized or large database. A small database doesn’t just only help for WordPress site performs faster and smooth for visitors, but also help the administrator, author, or editor write and update posts quickly.
At this point, I don’t want to write too long about clean up and optimize database so I recommend the fastest way to clean and optimize the database is using plugin! I have two recommended plugins are Optimize Database after Deleting Revisions (for who want to know more about using this plugin, go here!) and WP Sweep which help check, repair, fix and optimize your WordPress blog (check this post by Crunchify for using this plugin).
From Dynamics, Make Simple Static!
The static pages are designed with HTML and display the exact same content to all users. Truly, they don’t have to be simple plain text because HTML also can offer the style of text, and designs. They even can put multimedia such as photos, and videos, etc.
Usually, the browser always created the files called cache which stored the finished page results. But the cache stored only static content version, not dynamic version. That’s the advantage of static pages because it doesn’t have to download more data, as the blog page is simply saved as a complete package, but dynamic pages will need to download more data. So, a static page is very fast and causes less load to the server.
Install Caching Plugin!
Happily, it is very simple in WordPress to find a guarantee effective cache plugin. There are so many available plugins which are premium, freemium, or completely free.
My recommendations are surely here. For small sites, I recommend, the Cache Enabler as it is an undoubtedly caching plugin, which is effective and easy to use.
But for who needs more, say “Hi“ to the professional cache plugin is “WP Rocket“. Indeed, the plugin is different from many competitors but it makes things much easier and provides excellent support, which is very helpful and worth for beginners or inexperienced users.
Setting Up Cache-Control Headers
The often forgotten secret weapon when it comes to caching is the Cache-Control Headers. In the modern web page, the content that hasn’t changed such as a company logo for a long of periods. It shouldn’t repeatedly download because it’s wasteful on the bandwidth.
For thoughtfully, just for your blog logo, it needs at least 3 seconds to fully load. So If the browser cache now activated correctly, it can ensure that logo image is stored on the user’s PC for about one month or a year and hereafter no longer be downloaded from the server or must be requested. To ensures that, your blog response less to the server but fast to the visitors, you need to control how the cache files store the data locally on the visitor’s computer.
As a matter of choice, it should even set the browser cache for normal HTML pages, so the blog page doesn’t need to be regularly requested from the server, but for the case, only once per hour.
Now, simply copy the code below to the .htaccess file located in the root directory of WordPress.
# Cache Headers
# One month for image files
Header set Cache-Control “max-age=2678400, public”
# A couple hours for Cache HTML files
Header set Cache-Control “max-age=7200, private, must-revalidate”
# One day for Cache PDFs
Header set Cache-Control “max-age=86400, public”
Header set Cache-Control “max-age=2678400, private”
In this theory, the user will see new items only after the cache-time. For reliably, I set the image files for a month instead of a year in the browser cache.
The last chapter in Part 3 of the series!
In Part 3 of the series, we will go one step further with many valuable WordPress plugins that activate the Beast Mode for more performance on your blog.
Don’t worry! It won’t complicated because this series will be aimed at newcomers and inexperienced novices specifically.
Don’t forget the last part! It’s the best of all parts! Thanks for coming! 😉