Cache is kind of abstract, there are several optimizations you can do on a system that fit well into that word, like:
- Cache of static pages
- Cache of database queries
- Cache of service responses
- Cache of opcodes
I find that in most cases, so much concern with optimization is unnecessary, although some are part of good programming practices.
It all depends on the load of your system. If you are experiencing performance problems (too much bandwidth, processing, memory, disk space, etc.), start doing system optimizations from the simplest to the most complicated.
There are some generic and quite easy to implement tips like:
- Always stay tuned for the two biggest performance villains: network access and disk access.
- Some techniques like caching static files in the client’s browser using headers can alleviate your bandwidth issues.
- Importing common third-party CDN libraries can also help a little with bandwidth (example: https://developers.google.com/speed/libraries/devguide)
- Avoid the use of
SELECT *
or adopt ARCHIVE or MEMORY tables in a Mysql-based system can expedite queries.
And so on and so on...
I think the question applies to any platform, not just PHP.
– Oralista de Sistemas