Installed module, used default parameters (db caching), enabled Authcache debugging, but always getting such info:

No Authcache.info: NO_CACHE: "Page not cached."
HTML/JavaScript time: 113 ms
Authcache.ajaxRequest (sent)form_token_id[]: ["comment99"]
Authcache.ajaxRequest (received)form_token_id: {"comment99":"f8c750c23eb6f6a8ae84cafa62460ebd"}
HTML/JavaScript time: 255 ms

Drupal native cahing system is enabled, authcache enabled for every role except anonymous.

Comments

Jonah Ellison’s picture

This message usually means Authcache thinks the page should be cached, but something something happens at the last minute that prevents it from saving to the cache. Are there any Drupal status messages on the page or PHP errors? You may want to also try a different theme. If that doesn't work, open authcache.helpers.inc, go to the _authcache_shutdown_save_page() function, and start commenting out the "return" lines. Let me know what works and what doesn't.

Sorix’s picture

Commented first return.

  if(!$is_page_authcache) {
//    return;
  }

I've tried putting $is_page_authcache = 1; at page.tpl.php. No result, but is it correct way to enable global caching?

Now getting (NO Ajax errors without commented return):

Authcache.info

page_render: "1798.62 ms"
page_queries: "128 queries @ 335.39 ms (19%)"
cache_render: "n/a (first request?)"
cache_uid: "18"
cache_time: 1236802627
(page_age): "0 seconds"
HTML/JavaScript time: 93 ms

Ajax Response Error (parsererror)
ERROR: "{\"db_queries\":\"6 queries @ 19 ms\"}
"

With first commented "return" page loading really heavy (not 2 sec, it's about 5-8 seconds every refresh).

Jonah Ellison’s picture

Thanks for the info. The $is_page_authcache variable is changed to false in only two places (in authcache.module): when a Drupal status message is detected (these are almost always user-specific so pages with messages shouldn't be cached), or on hook_exit() when a new URL is passed (such as on a drupal_goto() command). So either one of those actions must be taking place. (If you do want to modify $is_page_authcache, make sure you use global $is_page_authcache; before changing it.)

It seems like there is something conflicting with Authcache. It may be a module or something of the sort. You may want to try disabling modules, or put up a fresh copy of Drupal with only Authcache enabled and see if it works by itself.

szy’s picture

Anybody got Authcache working? :]

Szy.

Jonah Ellison’s picture

I'd recommend trying the APC or memcached engine. The "db" and "file" engines seem rather finicky. APC gives a nice performance boost in general since it's an opcode cache that makes all your PHP scripts execute faster.

jayashreep’s picture

Authcache is not working.
I am using php version PHP 5.2.4-2ubuntu5.5 .
I have set global $is_page_authcache = TRUE; in authcache.module
Still I am getting the follwoing error:
Authcache Debug
No Authcache.infoNO_CACHE: "Page not cached."
HTML/JavaScript time: 64 ms Ajax request not sent.
HTML/JavaScript time: 79 ms

It will be of great help if you [Jonah Ellison] let me know what i need to do.
Thanks in advance
shree

jayashreep’s picture

Ouark’s picture

I had the same problem and it seems to be deprecated code:
Indeed, by inserting a debug message in _authcache_shutdown_save_page:

  if(count(error_get_last())) {
  	echo "<pre>".print_r(error_get_last()).'</pre>';
    return;
  }

Php returned :
Array ( [type] => 2048 [message] => Assigning the return value of new by reference is deprecated [file] => /Users/admin/Sites/drupal/sites/all/modules/authcache/api/CacheRouter.php [line] => 29 )

By remplacing in CacheRouter.php:
$this->map[$bin] =& new $cache_engine($bin);
By

     $tmp = new $cache_engine($bin);
    $this->map[$bin] =& $tmp;

It seems to work correctly

jwilde’s picture

Issue tags: +Performance, +cache

hey Ouark, thanks for the fix. this really helped.

Kind regards,

Jim

EvanDonovan’s picture

I think part of the problem here is that error_get_last() is overzealous, and counts even errors that don't show to the screen. See the code in #385924-7: Don't cache pages when there are PHP/MySQL errors for an implementation of error checking which doesn't stop the page from being cached on minor errors.

Also good to know that the APC and memcached flavors of Authcache are recommended. I might try Authcache again if I can get it to work with EAccelerator (would require me recompiling EAccelerator to expose the required hooks). The db and file methods seemed to work on our test site but took down the live site like a ton of bricks. It seemed like the problem was related to the {menu_router} rebuild oddly enough (see #251792: Implement a locking framework for long operations).

Jonah Ellison’s picture

Assigned: Sorix » Jonah Ellison
Status: Active » Fixed

Thanks for the feedback here. In beta7, I've made error_get_last functionality less zealous and modified CacheRouter.php (#8). There are also numerous debugging improvements (such as actually the showing the PHP error under "Authcache debug").

Status: Fixed » Closed (fixed)

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

Canadaka’s picture

i was having a simular problem in engines/memcache.php with the line

$this->memcache =& new Memcache;

I changed it to the following and it no longer gave me errors.

$tmp = new Memcache;
$this->memcache =& $tmp;

thedavidmeister’s picture

code posted by #13 works for me. Very much appreciated as my site goes from 3.5ms page load times to 11-15 second load times without it!