I'm trying to understand how to cache databases in a good way and what to do and what not to do. Though I want to make sure that I've understood everything correctly so far. Maybe you can help me?
At the moment I don't have any caching and I do everything locally using XAMPP. For storing data I use MySQL/PHPMyAdmin and to grab, add and update data I simply make Mysqli queries in PHP. As I said, I don't have any caching as of now, so I started looking for the best ways to do it.
After a quick search I found Redis. So my idea is to store data using MySQL and cache it with Redis. Is this a good way to do it or have I understood everything completely wrong?
If I'm right, how do I implement Redis? How do I cache data? Do I make a check in PHP if the data I want is cached, if it is then take it from the cache, else take it from the MySQL database.
Would really like to know if I'm on the right track.