Hacker News new | ask | show | jobs
by ehnto 2048 days ago
We call them cache keys. We use a hash of entirely arbitrary data you want a cache item to invalidate on when that data changes.

For example, a cached snippet of HTML for a related products section should invalidate if the product IDs change, so you hash the Item ID with the product IDs and bam, you got a cache key that will let you know when you need to reprocess that snippet.

Put that bad boy as a child of another snippet and you can cache the whole lot. It's cache keys all the way down!

Caveat: not worth the engineering effort for simple systems, just use an FPC and call it a day.

1 comments

FPC: Full Page Cache
Yep, sorry I should have expanded that.