Problem/Motivation
Authcache allows to specify a key generator function (authcache_key_generator variable) which is used to generate the Authcache key for anonymous users. If not specified this defaults to the base root, i.e. the URL of the site without the path. Specifying a key generator is necessary in order to partition the anonymous cache based on characteristics of the incoming request, e.g., to store different versions of a page for different regions of the world according to the clients IP address.
However, in order to make this work for both anonymous and authenticated users, it is necessary to replicate the code from the key generator also in a hook_authcache_key() implementation. This results in duplicated code.
Proposed resolution
Use anonymous key as a property when computing key for authenticated users.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | interdiff.txt | 2.63 KB | znerol |
| #14 | use_anonymous_key_as_a-2615492-14.patch | 16.23 KB | znerol |
| #12 | use_anonymous_key_as_a-2615492-12.patch | 13.99 KB | znerol |
| #4 | interdiff.txt | 963 bytes | znerol |
| #4 | use_anonymous_key_as_a-2615492-4.patch | 13.98 KB | znerol |
Comments
Comment #2
znerol commentedComment #4
znerol commentedComment #12
znerol commentedReroll.
Comment #14
znerol commentedFix reroll.