I've been trying to figure out why I'm unable to get my cache_page table to populate, despite the page cache being turned on and making sure there are no modules enabled that prevent page caching.
I narrowed down the issue to session.inc, on line 253:drupal_page_is_cacheable(FALSE);
That function is executed because the previous IF statement evaluated to TRUE:if (!empty($user->uid) || !empty($_SESSION)) {
The part that returns TRUE is:!empty($_SESSION)
I determine that when the cache is enabled, the anonymous user has this set:$_SESSION['cache_expiration']
I traced this being set in cache.inc on line 480:
// We store the time in the current user's session. We then simulate
// that the cache was flushed for this user by not returning cached
// data that was cached before the timestamp.
$_SESSION['cache_expiration'][$this->bin] = REQUEST_TIME;
I could be completely wrong about this, but this seems to be exactly what is happening. Is this by design? Perhaps I'm just missing something...
Thanks!