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?

CommentFileSizeAuthor
#5 authcache3.PNG6.56 KBswigle
#5 authcache2.PNG19.9 KBswigle
#5 authcache1.PNG4.18 KBswigle
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swigle created an issue. See original summary.

znerol’s picture

This can happen if authcache_builtin_cacheinc_retrieve_cache_page() returns before authcache_backend_init() gets called. Fire up your debugger and step through that function (or add error_log statements at strategic places).

swigle’s picture

I 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...

znerol’s picture

This is weird, authcache_builtin_cacheinc_retrieve_cache_page() gets called immediately when authcache_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 the cache_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).

swigle’s picture

FileSize
4.18 KB
19.9 KB
6.56 KB

Well, 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?

swigle’s picture

As 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.

swigle’s picture

Got anymore things i could check? I'm at a loss...

swigle’s picture

I 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:

foreach (variable_get('cache_backends', array(
  		'sites/all/modules/authcache/authcache.cache.inc',
  		'sites/all/modules/authcache/modules/authcache_builtin/authcache_builtin.cache.inc'
  )) as $include) {

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 :)

znerol’s picture

Navigate 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.

swigle’s picture

Nevermind 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!

znerol’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

swigle’s picture

Just a quick update (for google'rs), this ticket Status: Page EXLUCDED, Message: "No active cache backend" fixed my issue as well!