Separate out cache interface

chx - June 7, 2006 - 03:13
Project:Drupal
Version:x.y.z
Component:base system
Category:task
Priority:normal
Assigned:chx
Status:closed
Description

This patch lets you create contributed cache interfaces for Drupal. Files, Berkeley DB, memcached -- you name it.

AttachmentSize
separate_cache.patch5.02 KB

#1

chx - June 7, 2006 - 03:15

I forgot to add the new file.

AttachmentSize
separate_cache_0.patch9.57 KB

#2

chx - June 7, 2006 - 03:45

Made bootstrap a bit more fine grained and made 'fastpath' possible. The file caching already does it, and likely all non-SQL caching mechanisms will want it.

AttachmentSize
separate_cache_1.patch11.9 KB

#3

Jeremy@kerneltr... - June 7, 2006 - 13:38

Okay, so you're proposing that the 'cache_inc' variable is used to determine which cache.inc file to use? The problem being, you need to know the cache type before you can retrieve variables, otherwise you're dependant on pulling this information out of the database which means a fastpath is not possible.

To solve, I would suggest that the location of cache_inc (as well as the enabling/disabling of a fastpath) be configured in settings.php.

#4

chx - June 9, 2006 - 09:01

Jeremy, if you call variable_get before variable_init is called then it'll pull from $conf which is set in settings.php.

#5

Dries - June 9, 2006 - 09:17

I like this approach. :-)

I hate the name 'FASTPATH' though -- it isn't very descriptive. Also, the existing name 'PAGE_CACHE' is no longer accurate. FASTPATH also enables 'page caching'. Maybe we need to use DUMB_PAGE_CACHE and SMART_PAGE_CACHE, or EARLY_PAGE_CACHE and LATE_PAGE_CACHE?

(Also, if the database caching could use dumb or early page caching, we'd probably see significant performance improvements as well. Cfr. with Jeremy's fastpath file caching.)

#6

moshe weitzman - June 13, 2006 - 04:05
Status:patch (code needs review)» patch (reviewed & tested by the community)

I did a code review and quite some testing. Everything is in order.

Instead of fastpath and page_cache, i also like EARLY_PAGE_CACHE and LATE_PAGE_CACHE. I rerolled with this naming, and and set to RTBC.

#7

chx - June 13, 2006 - 04:31

Moshe seems to have forgotten the file. I have rerolled with the suggested name change.

AttachmentSize
separate_cache_2.patch12.17 KB

#8

Dries - June 14, 2006 - 14:01
Status:patch (reviewed & tested by the community)» fixed

Committed to CVS HEAD. Thanks.

#9

Anonymous - June 28, 2006 - 14:16
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.