I've set the version to 7.x-1.x-dev but the issue is actually in the 7.x-1.x branch, I can't get -dev to run at all right now. Anyway, the issue here is that variables aren't loaded yet when in authcache_retrieve_cache_page some things don't work as expected. The issue I'm seeing is that Cache-Control's max-age isn't respecting the setting I have. This in turn nullifies the usefulness of varnish for anonymous users.
Inside of include/bootstrap.inc, function drupal_serve_page_from_cache there is a variable_get('page_cache_maximum_age', 0) call being made. Without authcache enabled, this will work properly. But with authcache enabled, Drupal isn't bootstrapped far enough for variables to load. This can be fixed/worked around by adding drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES, FALSE); to authcache.inc in the authcache_retrieve_cache_page function.
Comment | File | Size | Author |
---|---|---|---|
#4 | 1826284-bootstrap-to-variables-and-deny-access-to-filtered-ips-3.diff | 729 bytes | znerol |
Comments
Comment #1
znerol CreditAttribution: znerol commentedA call to
drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES, FALSE)
would also initialize the database defeating the purpose of authcache alltogether. You'll be better off by settingpage_cache_maximum_age
in yoursettings.php
.Comment #2
simg CreditAttribution: simg commentedactually Authcache still works surprisingly quickly if you initialise the database. (around 5ms with database compared to 1ms without)
Comment #3
znerol CreditAttribution: znerol commentedActually it would be possible to handle that like in drupal core. The function _drupal_bootstrap_page_cache checks whether the setting
page_cache_without_database
is set. If it is not set, it will bootstrap up to the phaseDRUPAL_BOOTSTRAP_VARIABLES
before delivering the page.Comment #4
znerol CreditAttribution: znerol commentedCopy-paste patch with the relevant code from _drupal_bootstrap_page_cache. Also includes a call to drupal_block_denied as a bonus.
Comment #5
znerol CreditAttribution: znerol commentedClosing this again. I recommend to hard-code
page_cache_maximum_age
insettings.php
.