Caching might get messy if you don’t want to use expiration times.
You’ll need some kind of reference to check if there were any changes made.
You could use filemtime() in combination with timestamps of the last modification of the editable components.
This means you’ll still have to query a database -assuming the timestamps are stored along the data in the database- to get the timestamps to compare them with the filemtime of the cached file.
In my experience, caching with expiration times and cache ‘namespaces’ work best.
With every change the cache is cleared for that component or the entire namespace where that component is located.
But i want to know your algorithm to check how pages content changed, i can’t understand your mean about :
You could use filemtime() in combination with timestamps of the last modification of the editable components.
This means you’ll still have to query a database -assuming the timestamps are stored along the data in the database- to get the timestamps to compare them with the filemtime of the cached file.