Its this code:
https://github.com/discourse/discourse/blob/96183dbf6b5c4688507f3fa4148c681b8d4f552f/lib/middleware/anonymous_cache.rb