Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299521

Can't enable Page Caching for anonymous users

$
0
0

This may or may not be a bug. I'm unable to enable page caching for anonymous users and can't find the reason.

I know that page and block caching is important for most Drupal sites. The other day I noticed one of our sites had neither of these caching types enabled. A warning on the Performance page stated that “block caching may be disabled due to some modules that impose content access restrictions.” True enough, I found the Content Access module and disabled it and that allowed me to enable block caching. However, Page caching still can’t be enabled.

Searching my files for "Cache pages for anonymous users," I found the source of the page cache switch on line 1707 of system.admin.inc:

$cache = variable_get('cache', 0);    // default value is page cache = FALSE.
  $form['caching']['cache'] = array('#type' => 'checkbox','#title' => t('Cache pages for anonymous users'),'#default_value' => $cache,'#weight' => -2,
  );

The default is 0. My question is, would changing the 0 to 1 force page caching ON? Or would that be wrong and ill advised? To avoid hacking core, I assume I would copy system.admin.inc to another location, such as /sites/all/default/files or my custom module folder if that sort of thing were permitted. Does Drupal even let you tamper with this system file?

I’m not finding many clues in Watchdog or Google searches. I did find a very good page on caching options:

https://www.drupal.org/docs/7/managing-site-performance-and-scalability/...

I will have to experiment. If anyone can share particular guidance that would be most helpful.

1. Opcode caching,
2. Database caching,
3. Web server (proxy) caching, eg Varnish

Option one looks promising, https://www.drupal.org/project/apc


Viewing all articles
Browse latest Browse all 299521

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>