In order to pass information for the AJAX-phase, a JavaScript snipped is appended to each cached page in a shutdown function. This results in several problems when caching non-HTML content. In order to prevent unexpected behavior, attachment of the script settings should be done using the standard drupal way using drupal_add_js and Drupal.settings
. JavaScript attached to a page in this way will never interfere with non-HTML content.
Because drupal attaches JavaScript when the page is rendered, thus earlier than the current authcacheFooter
injection, some authcache information is not available at page build time. Luckily there is no need for the core authcache functions to run as late as possible, only the debug information must be collected at the very end of a page cycle.
The idea is now to save this debug information along with the compressed page into the same cache-object. This information can be accessed later during the ajax phase. The only problem is that there is no way to store debug information when a page is not cached. In order to cover that case, the reason for when a page was not stored is written into a cookie. Such that it can be accessed later from the debug JavaScript.
As an extra benefit of this approach, we have better protection of the debug information because the AJAX phase is authenticated. Therefore the risk of leaking information via the cached authcacheFooter
is reduced.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1890564-get-rid-of-authcache-footer-4.diff | 44.17 KB | znerol |
#4 | 1890564-get-rid-of-authcache-footer-3.diff | 28.01 KB | znerol |
#1 | 1890564-get-rid-of-authcache-footer.diff | 28.28 KB | znerol |
Comments
Comment #1
znerol CreditAttribution: znerol commentedPatch is against 7.x-1.x plus patches applied up to comment 109 in #966152-109: Authcache » Drupal 7 port.
Comment #2
znerol CreditAttribution: znerol commentedComment #3
znerol CreditAttribution: znerol commentedForgot to comment on that hunk:
Diffing pressflow 7 against stock drupal 7 gives no indication that this cookie has been removed. I therefore did not bother keeping that hack.
Comment #4
znerol CreditAttribution: znerol commentedRebase on top of #966152-115: Authcache » Drupal 7 port.
Comment #5
znerol CreditAttribution: znerol commentedRebase on top of #966152-122: Authcache » Drupal 7 port. Additionally I'm in the phase of reworking the JavaScript part into behaviors. The debug widget and browser-side caching (max_age) still need some work. Apart from that most things are converted and operational.
Comment #6
znerol CreditAttribution: znerol commentedImplemented in 7.x-2.x-dev.