Work with page cache, not instead of it

bjaspan - December 27, 2007 - 13:27
Project:Boost
Version:6.x-1.x-dev
Component:Core compatibility
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

My client wants Drupal to keep accurate hit counts for their articles and therefore cannot use Boost for them. However, their tag-based search page is fairly expensive to generate and we would love to use Boost for it. So what I want is to enable Boost for a subset of paths and leave the database-backed page cache enabled for everything else. However, enabling Boost disables the built in page cache complete.

For now this client has moved away from Boost so I am unlikely to implement this in the near term.

#1

Arto - October 29, 2008 - 14:39
Version:5.x-1.x-dev» 6.x-1.x-dev
Component:Code» Core compatibility
Assigned to:Anonymous» Arto

I'll likely implement this in the 6.x branch.

#2

mikeytown2 - June 7, 2009 - 05:52
Assigned to:Arto» Anonymous

Need to see if this module can help out.
http://drupal.org/project/cacheexclude

#3

mikeytown2 - June 7, 2009 - 22:42

Looked at the above module and all it does is set $GLOBALS['conf']['cache'] = FALSE; for pages it doesn't want cached, which corresponds to variable_set('cache', CACHE_DISABLED).

This is inside boost_admin_settings_submit()

  // Forcibly disable Drupal's built-in SQL caching to prevent any conflicts of interest:
  variable_set('cache', CACHE_DISABLED);

Drupal's cache gets set via drupal_page_footer() => page_set_cache(). boost_exit() and _boost_ob_handler() are to late in terms of doing $GLOBALS['conf']['cache'] = TRUE;. Need to see if I can move the drupal_get_headers() out of _boost_ob_handler() and into an earlier stage; via boost_preprocess_page(). Main goal is to enable drupal's cache when boost won't cache that page. Need to see if CACHE_AGGRESSIVE is compatible with boost; it gets evaluated in _drupal_bootstrap(), controls the calling of bootstrap_invoke_all('boot') (hook_boot()), bootstrap_invoke_all('exit') (hook_exit()). Boost has a hoox_exit() call but this only gets bypassed if the cache is set for that page & CACHE_AGGRESSIVE. So my guess is boost is compatible with CACHE_AGGRESSIVE.

Long story short:
Inside new function boost_preprocess_page() IF boost is going to cache page THEN set $GLOBALS['conf']['cache'] = FALSE. Re-enable normal cache settings on performance page.

#4

mikeytown2 - June 8, 2009 - 02:05

man this is an annoying bug... #484756: Page Cache

#5

mikeytown2 - June 8, 2009 - 02:31
Status:active» needs review

here is the initial patch for this

AttachmentSize
boost-204174.patch 8.83 KB

#6

mikeytown2 - June 9, 2009 - 09:54

More refined patch, decided to enable aggressive caching with boost.

#7

mikeytown2 - June 9, 2009 - 09:55
AttachmentSize
boost-204174.patch 10.87 KB

#8

mikeytown2 - June 10, 2009 - 01:46
Status:needs review» fixed

committed.

#9

mikeytown2 - June 12, 2009 - 20:09
Status:fixed» needs work

Display # of pages for each cache & ability to flush entire cache (core or boost) on performance page.

#10

mikeytown2 - June 15, 2009 - 07:16
Status:needs work» fixed

moving additional things to #453426: Merge Cache Static into boost - Create GUI for database operations.
Main issue was fixed so marking this as fixed.

#11

System Message - June 29, 2009 - 07:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.