Essentially if you implement the final optional lines in the Readme everything works great for authenticated users but unauthenicated users get a failure:
Fatal error: Call to undefined function db_query() in /var/www/includes/cache.inc on line 335
Call Stack
# Time Memory Function Location
1 0.0002 656240 {main}( ) ../index.php:0
2 0.0104 737664 drupal_bootstrap( ) ../index.php:20
3 0.0177 760192 _drupal_bootstrap_page_cache( ) ../bootstrap.inc:1908
4 0.0182 782672 drupal_page_get_cache( ) ../bootstrap.inc:2047
5 0.0182 783504 cache_get( ) ../bootstrap.inc:859
6 0.0182 784384 DrupalDatabaseCache->get( ) ../cache.inc:49
7 0.0182 784816 DrupalDatabaseCache->getMultiple( ) ../cache.inc:319
Comments
Comment #1
R.Muilwijk CreditAttribution: R.Muilwijk commentedCould you please provide more information. I was not able to reproduce.
Comment #2
mbinde CreditAttribution: mbinde commentedSame error here. Removing the final optional lines from the Readme solved it as well.
Not sure what information is useful, but: Ubuntu 10.04, apc package, Drupal 7.7.
Comment #3
travelerttSame error. "Call to undefined function db_query() in [\drupal\includes\cache.inc] on line 335".
Windows Server 2003
Drupal 7.7
Removed the two optional lines and site came back up. Was working for authenticated users, soon as I signed out as USER1 account all pages returned White screen of death with that error.
Comment #4
travelerttComment #5
dropbydrop CreditAttribution: dropbydrop commentedI had the same problem as other people and it broke a site.
The module needs maintenance. It's another essential module for D7 that is slow to have a stable release.
Comment #6
ASupinski CreditAttribution: ASupinski commentedI've come around to this and discovered that this is really a user not comprehending the documentation issue (sorry) , anonymous users will get this error if the setting
is set without also including this setting
or some other non-database caching being set for the page cache.
This is spelled out in the readme but I suppose could be spelled out more explicitly.
Comment #7
dropbydrop CreditAttribution: dropbydrop commentedcan i use this in combination with varnish cache?
Comment #8
JGO CreditAttribution: JGO commentedHmm not sure, I get a blank page with this config on D7 as soon as the page is visited after the first time (so 1st time ok, afterwards blank):
This works without problems though:
BTW using: 7.x-1.0-beta3, should I try latest dev ??
Comment #9
R.Muilwijk CreditAttribution: R.Muilwijk commentedAs you can see the error is in a database query. So something has went wrong with loading the correct cache backend.
Comment #10
Heine CreditAttribution: Heine commentedThis is due to a bug in Drupal core. I'll open a separate report in the core queue and keep this one here to allow people to find it and/or allow Raymond to add instructions to README.txt.
The root cause:
Variables are not loaded when serving a cache hit when page_cache_without_database = TRUE. Variables are loaded when the caching system needs to serve a cache miss. This causes an 'impedance mismatch' between the code that fetches and serves a page from cache and code that saves a page to cache when the variable page_compression is set to FALSE in the interface;
Upon serving a cache miss, page_compression = FALSE and an uncompressed page is saved to cache
Upon serving a cache hit, page_compression has its default value TRUE and drupal_serve_page_from_cache serves the uncompressed data with a Content-Encoding: gzip header. Browsers do not appreciate this.
Possible workarounds:
Comment #11
Heine CreditAttribution: Heine commentedI added #1476810: (followup) drupal_serve_page_from_cache can serve uncompressed data with Content-Encoding gzip header with page_cache_without_database = 1
Comment #12
Heine CreditAttribution: Heine commentedWe can safely won't fix here; see #11 for the core issue.
Comment #13
Exploratus CreditAttribution: Exploratus commentedThis is still a problem, at least for me. I dont understand how people are using this module for anonymous users? Is this only happening to some people, or are most just not adding the last couple of lines to settings.php?
Comment #14
Heine CreditAttribution: Heine commentedExploratus, you need to either enable page compression or set the page_compression variable to FALSE in settings.php. See #11.
Comment #15
Exploratus CreditAttribution: Exploratus commentedSo will this only work without gzip compression?
Comment #16
henkit CreditAttribution: henkit commentedDo you perhaps have domain access enabled?
If i put the apc settings below the domain access it works...but then update is not working.
Comment #17
emmonsaz CreditAttribution: emmonsaz commented#6 solution worked for me (after changing the value to a string):
/**
* Add APC Caching.
*/
$conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
$conf['cache_class_cache'] = 'DrupalAPCCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';
//$conf['apc_show_debug'] = TRUE; // Remove the slashes to use debug mode.
$conf['cache_class_cache_page'] = 'DrupalAPCCache';
$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;