You must maintain a timestamp of whenever the database or table you want to cache changes. If there are related tables, or ones which change on a similar timeframe, you can group them into families which share the same timestamp.
Whenever you want data you must first ask for the timestamp. If it hasn't changed, use the cached data. If it has changed, ask for the fresh data, update your cache, and ask for the timestamp of all ancestral data recursively.
A checksum doesn't work because they can collide and you'll have to ask for the fresh data anyway to check for collisions. An old/changed flag won't work because you won't know when the data was changed, it could have been before your previous timestamp. A version ID that always increases after every change and never decreases will also work.
If you're using a RESTful web service the GET HEAD code will return you only the HTTP header, which can include a timestamp. If your web service does not include timestamps you will have to define new ones that return them.