You may probably have heard about web cache. And may or may not already have cached your site. Caching your site is a good idea. But you should be doing it in a proper way. You may be worrying if you are doing proper cache or not. If you have correct cache settings or not. This article will probably be for you.
Web cache is really useful to speed up your site. It helps users to get through content quickly. It also reduces server load. Server does not have to look for the database each time. Hence faster speed and less TTFB. Which brings more traffic and revenue.
I’ve created this post just for you to help with this. It’ll really be helpful for you hopefully.
I suggest you to read this post even if you have already setup cache. So, STAY TUNED.
What is Cache?
Cache is a system which stores temporary files on your computer or in a temp folder of websites.
Cache are of various types, we will discuss web cache.
Cache makes fast user experience.
Mostly those files are cache which are accessed frequently.
When you visit a site, it’s files like some logo images, style and others save on your computer temporary.
When you serve that site again, you experience fast loading.
Following questions might be appearing in your head:
- What is Cache Used For?
- Where are Caches Stores?
- Do I Need Cache?
- What Problems Do Cache Cause?
- Is Caching Worth It?
- Is Cache Necessary?
- How Can I Cache My WebSite?
- What Happens If You Purge Cache?
I’ll be answering all of these questions one by hope.
I hope you will be satisfied.
You can ask question in the comment section if you need to.
What is Cache Used For?
Cache is use to create fast user experience.
I works by saving most accessed files in a temp folder.
When someone visits that webpage again, those temp files are loaded instead of from database requesting…
Where are Caches Stores?
Cached files are stored temporary in a folder usually name “Cache”.
Those files are temp files and are deleted and modified after specific time when Garbage Collection runs.
You may also need to manually delete or purge cache in some cases.
Do I Need Cache?
If you want fast user experience, you should probably cache you site.
Cache is of different types i.e serve cache, browser cache and CDN cache.
You should use all of these.
In the case of server cache, temp files of most visited are stored in a raw temp file on your server.
When a user requests that webpage, files are loaded from those temp files instead of making request to database to generate page.
In the case of browser cache, temp files like Style.css, static images like logos, favicon and some other static files are stored on your computer.
So, your web browser does not need to make new request to serve for those files each time when a user visit some other pages of your site.
In the case of CDN cache, temp files of web pages are stored at CDN servers and are served without making any request to server end.
So, it’s a good idea to cache most static files like style.css, images etc on a CDN like Cloudflare.
What Problems Do Cache Cause?
Sometimes, some files get old and outdated.
It happens when a page is changed and user is still getting cached files.
It causes problems.
Sometimes, page don’t load properly in the case if files like style.css are changed.
It can also cause to serve old content even if you have updated a post or a page on your site.
But, this problem can be fixed a clearing cache.
Even after clearing cache, user may still experience problems until or unless those cache files get expired or cleared manually from web browser,
Is Caching Worth It?
Usually, when you visit a site through Google, you notice that first page of that site takes time.
After first visit, all other pages of same site loads much faster.
How does that happen!
It is because of cache files which are stored on browsers.
It included style.css, images like favicon and logo and many other static files which don’t change very often.
So, during other page loads of same site, those files are accessed locally stored on your computer temorary.
It’s the all magic of Browser Cache system.
In the case if you are using shared hosting, you should be using server cache too.
When many visitor visit a same page again and again, it will cause server load.
You server may go down temporarily.
But, if you have setup server cache, temp saved files of those pages are loaded instead of making request to database.
It reduces server load and the magic works.
You, answer to this question is Yes.
You must be using cache because Google is considering site speed for ranking too.
Is Cache Necessary?
If you are on not using shared hosting and your server is very much fast, you still should be using cache.
It will create much fast user experience.
But if your are on shared hosting as most people are, you should definitely be using cache.
In the case if your site is almost completely static and does not change very often, you should also be using CDN cache like cloudflare.
How Can I Cache My WebSite?
Cache are of three types i.e Browser cache, Server cache and CDN cache.
If you wanna setup browser cache, you should be using some codes in your .htaccess file or you can also you some plugin for that.
It will tell browser to stored static files locally.
In the case if you wanna setup server cache, you can use plugin like WP Super Cache, WP Rocket or LiteSpeed.
WP Super Cache is best choice if you are on shared hosting.
WP Super Cache don’t uses much resources.
If you don’t care about resource usage, try LiteSpeed or WP Rocket.
LiteSpeed is also a built in plugin in some hostings.
What Happens If You Purge Cache?
Purging cache clear all the saved temp cached files.
You need to purge cache, if your site has changed or you have update content or post or modified some page.
Purging cache may temporary slow your site.
It is because everything needs to be cached again.
After sometime, everything will be fine again.
No matter, if you are on shared hosting or what, you should be using all of the cache system i.e Browser Cache, Server Cache and CDN cache too.
Everyone has it’s own use.
Browser cache works by storing cahe on your browsers.
Server cache works by storing temp cached files on your hosting server.
CDN like cloudflare store caches on their Network server for faster experience.