A lot of people have learn about caching in their academics, but a lot of people never get a chance to use it especially if you are in your initially years of PHP development. So, here's a short brief about what it is and further reading guide.
What it is?
Caching is a technology where you utilize file system or other fast access memory to temporary store data which is used frequently instead of getting it from database every time. So, if you have a website like ours, where you have published say 1000 articles. When a person views an article the system goes and search for the article content from the database of 1000 articles which is a time consuming operation. While we know that when you publish a new article, most of the people will be viewing that article only. So, if you save that article in temporary memory for 1 hour and there are 100 request in that one hour. All those request will see the content from fast temporary memory, instead of searching it in the whole database.
Why you should use it?
As you can see from the example above, you need to use it to optimize your web application. It has a lot of benefits as compared to traditional sql database in certain situations.
Where you should use it?
You should use it to optimization your application when you have a heavy traffic website and you need to fetch the same data from database repetitively.
If you know other better uses of caching be sure to put a comment and we will include it.
Here is an example implementation of caching in PHP:
http://cachingtutorial.blogspot.in/
What it is?
Caching is a technology where you utilize file system or other fast access memory to temporary store data which is used frequently instead of getting it from database every time. So, if you have a website like ours, where you have published say 1000 articles. When a person views an article the system goes and search for the article content from the database of 1000 articles which is a time consuming operation. While we know that when you publish a new article, most of the people will be viewing that article only. So, if you save that article in temporary memory for 1 hour and there are 100 request in that one hour. All those request will see the content from fast temporary memory, instead of searching it in the whole database.
Why you should use it?
As you can see from the example above, you need to use it to optimize your web application. It has a lot of benefits as compared to traditional sql database in certain situations.
Where you should use it?
You should use it to optimization your application when you have a heavy traffic website and you need to fetch the same data from database repetitively.
If you know other better uses of caching be sure to put a comment and we will include it.
Here is an example implementation of caching in PHP:
http://cachingtutorial.blogspot.in/