esmero/format_strawberryfield

Internal Page Cache does not "vary" for Anonymous users in 9.x, 10.0 and 10.1. IP embargoes needed that. Kill cache

Closed this issue · 2 comments

What?

Basically anonymous users have no Cache Context. They do not vary. So IP embargoes only work for Logged in users in a reliable way right now. Solution?
1.- Check if embargoes are enabled at all
2.- Check if user is anonymous
3.- If anonymous, check if IP data (for allowing/not allowing) is at all present in the ADO
4.- If present, check if the Internal Page Cache module is enabled (if not, the smart cache, which is aware but also slower, can deal with it, treating anonymous as a varying user) and Kill the Page Cache.
5.- Set any output after to max-age = 0 to ensure there is not even client level caching

This needs to be applied at a single point (good!) because we have a cache resolving service (good Diego)

@alliomeria for tomorrow

Solved via 7e95fa6

I will also make a backwards compatible one for 1.2.0 soon