Just above iframe and ajax it needs to say memcache/queue/additional check and you will be fine. Seriously - it's not an architecture problem here, just a way of figuring out how to make your code aware of changes outside of its process.
Edit: forgot to mention - think about your worst case before/while you design and you will then have a problem in yours hands down the track that says - 90% of visitors do A (subset of B) and my design caters for B. How do I optimize for A?
Instead of - my design caters for A, but a fair few do B - how can I extend A cater for B?
Architects - agile, waterfall, whatnot - they can help you with this!
Edit: forgot to mention - think about your worst case before/while you design and you will then have a problem in yours hands down the track that says - 90% of visitors do A (subset of B) and my design caters for B. How do I optimize for A?
Instead of - my design caters for A, but a fair few do B - how can I extend A cater for B?
Architects - agile, waterfall, whatnot - they can help you with this!