Currently I know of only two ways to cache data (I use PHP but I assume that the same will apply to most languages).
Are there any other (perhaps better) ways of caching or is it really just this simple?
Maybe you want to explicit more precisely what you want to cache. You have all this opportunities to cache:
From my experience, I'd bet you that your code can be improved a lot before we start to talk about caching things. Consider, for example, how well structured is the navigation of your site and how well you control the user experience. Then check your code with a tool like XDebug.
Verify also how well are you making your SQL queries and how well are you indexing your tables. Then check your code again to look for opportunities to apply the rule "read many times but write just once"
Use a simple tool like YSlow to hint other simple things to improve. Check your code again looking for opportunities to put logic in the browser (via JavaScript)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With