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

Comments

znerol created an issue. See original summary.

znerol’s picture

Status: Active » Needs review
StatusFileSize
new13.43 KB

Status: Needs review » Needs work

The last submitted patch, 2: use_anonymous_key_as_a-2615492-2.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
StatusFileSize
new13.98 KB
new963 bytes

The last submitted patch, 2: use_anonymous_key_as_a-2615492-2.patch, failed testing.

The last submitted patch, 2: use_anonymous_key_as_a-2615492-2.patch, failed testing.

The last submitted patch, 2: use_anonymous_key_as_a-2615492-2.patch, failed testing.

The last submitted patch, 2: use_anonymous_key_as_a-2615492-2.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: use_anonymous_key_as_a-2615492-4.patch, failed testing.

The last submitted patch, 4: use_anonymous_key_as_a-2615492-4.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
StatusFileSize
new13.99 KB

Reroll.

Status: Needs review » Needs work

The last submitted patch, 12: use_anonymous_key_as_a-2615492-12.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
StatusFileSize
new16.23 KB
new2.63 KB

Fix reroll.