I'm implementing authcache on a test drupal installation based on a copy of a high-traffic website i'm managing.
I've allready installed memcache to speed up caching as a whole and wanted to try authcache next.
I've followed the instructions and read a few tutorials and my configuration seems to be correct, and the statuspage of the installation says that "Authcache: hook_authcache_backend_cache_save() implemented: authcache_builtin" and "Authcache builtin cache backend : Using MemCacheDrupal as cache backend". Both rows are green and don't show errors.
Yet when i open any page that should be cached, the authcache debug gives the same error:
Cache Status: "Page EXCLUDED"
Message 1: "Excluded: No active cache backend."
Both can't be right.
My settings config:
/**
* Use Memcache for the page cache and authcache keys.
*/
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_class_cache_page'] = 'MemCacheDrupal';
$conf['cache_class_cache_authcache_key'] = 'MemCacheDrupal';
$conf['cache_class_cache_bootstrap'] = 'MemCacheDrupal';
$conf['memcache_servers'] = array('<server address>' => 'default');
/**
* When serving cached pages, do not bother connecting to the database.
*/
$conf['authcache_builtin_cache_without_database'] = TRUE;
/**
* All customized settings influencing page delivery need to be set here.
*/
// Deliver gzip compressed pages if possible
$conf['page_compression'] = 1;
// Allow browsers to store the page for up to 10 minutes
$conf['page_cache_maximum_age'] = 600;
/**
* Required configuration for Authcache Builtin Storage Backend.
*/
$conf['cache_backends'][] = 'sites/all/modules/authcache/authcache.cache.inc';
$conf['cache_backends'][] = 'sites/all/modules/authcache/modules/authcache_builtin/authcache_builtin.cache.inc';
Anyone got any ideas?
Comment | File | Size | Author |
---|---|---|---|
#5 | authcache3.PNG | 6.56 KB | swigle |
#5 | authcache2.PNG | 19.9 KB | swigle |
#5 | authcache1.PNG | 4.18 KB | swigle |
Comments
Comment #2
znerol CreditAttribution: znerol commentedThis can happen if
authcache_builtin_cacheinc_retrieve_cache_page()
returns beforeauthcache_backend_init()
gets called. Fire up your debugger and step through that function (or adderror_log
statements at strategic places).Comment #3
swigle CreditAttribution: swigle commentedI did as you said. But nothing got logged. I also added exit()'s to the beginning of both functions, but nothing happens. They don't seem to get called at all...
Comment #4
znerol CreditAttribution: znerol commentedThis is weird,
authcache_builtin_cacheinc_retrieve_cache_page()
gets called immediately whenauthcache_builtin.cache.inc
is loaded. And that should happen from within_drupal_bootstrap_page_cache()
. I have no idea how that could possibly fail as long as thecache_backends
variable is set correctly. Which PHP version are you using? Do you have some special setup? Do you have the option to try it in another environment? Or maybe set up a fresh install in your current environment (only drupal core and authcache).Comment #5
swigle CreditAttribution: swigle commentedWell, i don't know what to tell you... Module authcache is enabled, the statuspage tells me it's active and has an active backend, but the debug popup on every page tells me that i actually don't have one.
I'm currently testing on an alternative (but simpler) environment. Just an Amazon instance using Apache/2.4.16 (Amazon) PHP/5.6.17 with a remote MySQL RDS
Other then that there's nothing "special" about the install/environment. Is there something specific you're thinking about?
Comment #6
swigle CreditAttribution: swigle commentedAs per #4, i've created a new drupal install on the same environment, samen RDS instance etc.
I've only installed core and authcache and memcache.
I've copied all settings from settings.php from the drupal install that doesn't work and on this clean install everything works like it's supposed to. The admin says it's using memcache and so does the debug window per page. After the cache-warming, pages are lightning fast (on a simple "basic page").
So i think we can succesfully rule out envirnoment issues.
Comment #7
swigle CreditAttribution: swigle commentedGot anymore things i could check? I'm at a loss...
Comment #8
swigle CreditAttribution: swigle commentedI think i've found the issue. When debugging i've dug through de steps taken to activate cache backends and finally ended up in the _drupal_bootstrap_page_cache() function. This calls variable_get('cache_backends', array()) and this is actually empty!
As a test i replaced this variable_get with:
So i force the backends. Now it actually says it has an active backend (har har).
But now i have an error in the debug window saying:
Cache Status: "Caching CANCELED"
Message 1: "Geannuleerd: PHP Error: Unterminated comment starting line 2"
Page Render Time: "1507.62 ms"
Page Age: "2 seconds"
Settings
I'll investigate this error further. If you know anything, please let me know!
Also, if anyone knows why my settings set in settings.php file are not available by way of "variable_get()" i would be greatful to hear it :)
Comment #9
znerol CreditAttribution: znerol commentedNavigate to Administration » Configuration » Development » Logging and errors and set Error messages to display to All messages.
Also you might find additional hints in the Administration » Reports » Recent log messages.
Comment #10
swigle CreditAttribution: swigle commentedNevermind fixed it, problem somewhere in code.
Issue remains that settings set in my settings file aren't set when initiating the cache, but this is not a problem of authcache.
Now i need to find out why when hooking into autcache_key_properties or authcache_key_properties_alter seems to disable cache, or prevents the cache from being retrieved/set properly, but that is a problem not for this topic.
Thanks for your help so far!
Comment #11
znerol CreditAttribution: znerol commentedComment #13
swigle CreditAttribution: swigle commentedJust a quick update (for google'rs), this ticket Status: Page EXLUCDED, Message: "No active cache backend" fixed my issue as well!