title: How can I invalidate cache the right way?
body: <p>I have a very specific cache situation. We use several solutions for caching and I wonder what is the best solution to invalidate the cache on a user action.</p>
  
  <p>The cache is like so</p>
  
  <ul>
  <li><p>First layer: CDN caches the full page as HTML for logged-out users</p></li>
  <li><p>Second layer: full page cache in memcached for logged-out users
  the reason I have the second layer is to respond to edges, sometimes not all edges are cached, so I want to "answer" the edge from cache as well.</p></li>
  <li><p>Third layer: cache HTML partials and database data for logged-in users.</p></li>
  </ul>
  
  <p>My problem is that my invalidation process is very much based on the third layer right now, and I don't answer the second and first layer well enough.</p>
  
  <p>My question is: what is the best way to invalidate the cache on the full URL from a cache key that has absolutely no coupling with the URL? For example, if I have a trip plan, inside the trip plan there are comments, I want to invalidate the full page trip plan URL when a user comments with a new comment.</p>
  
  <p>Comment model has no URL, and the "parent" also doesn't have the URL, the same comment will also apear in the city page, so it's completely a reusable object and partial.</p>