When a user starts loading your website, his browser immediately starts downloading all the necessary files from a server on which your website is located. Depending on user’s internet connection speed and server capabilities, the site can be loaded faster or slower. Of course, each party wants to load the site as fast as possible and you, as an admin, have to do all in your power to make your site lightning fast.
Improve WordPress speed and cache static files longer
That first visit to your site is dependent entirely on the internet connection and the server, but you can make the change for your regular visitors. They probably won’t be aware that the changes are done, but they will always have in mind how fast your site really is. You can put yourself in their shoes – if the sites take seconds to load each page, you probably won’t be sticking around for too long no matter how good the content is, right?
Caching technology takes some of the files from the server and stores them on a local computer. Then, if a user visits the same site again, the browser will check for stored files and will load them instantly instead of downloading them from the remote server once again. This makes loading time much shorter, improves WordPress speed and that makes a visitor much happier.
By using the following code, you can tell WordPress to cache static files for a longer period of time. Before you run to copy and paste the code, take a minute to reconsider– how often do you make changes to your website, what kind of content do you have and can this really help your site if you prolong caching?
- Open .htaccess file
- Copy and paste the following:
- Save changes
After you save changes, your server will change access time for storing those files locally. If you’re not comfortable modifying .htaccess file by yourself, you can do the same by using a simple plugin.