Change record status: 
Introduced in branch: 
7.x-2.x
Introduced in version: 
7.x-2.0-beta5
Description: 

Regrettably supporting Ajax enabled forms in Authcache is very hard. Over the past year two critical issues have been reported, both caused by Ajax enabled forms and both affecting integrity of data for logged in users. The underlying reason was the same: A form which stored information about the logged in user in a value element.

Value elements are part of the form structure, but they do not appear on the rendered page. It is not obvious for developers / site-builders that forms with value elements potentially contain user specific data, and therefore it is impossible to judge whether or not a form needs out-of-band personalization (via Ajax or ESI) by looking at it.

Because of that, Authcache will cancel page caching if it detects a value element on an Ajax enabled form unless it is explicitly handled by an integration module and marked as cachable. The message emitted by Authcache Debug is:

Canceled: Value element contained in the cacheable form some_form_id. Please enable a suitable Authcache integration module for that form or file a support request.

Authcache ships with integration modules for Comment and Commerce Cart (new in 7.x-2.0-beta5).

Site builders

After upgrading to 7.x-2.0-beta5, enable Authcache Debug and test pages with Ajax forms.

Developers

Every value element needs manual investigation in order to decide whether or not it is cacheable. If it contains user-specific data, then this needs to be removed from within a form alter and restored in a value callback. Take a look at the new Authcache Commerce module for some hints.

Screenshot of Authcache Debug with the new message

AttachmentSize
ajax-add-to-cart.png343.61 KB
Impacts: 
Site builders, administrators, editors
Module developers