This project is not covered by Drupal’s security advisory policy.

Pressflow Preempt is a caching module with several benefits over the Drupal core cache, although it is not an appropriate replacement in every case. A simple use of this module's capabilities is Pressflow Preempt Panels.

Advantages

  • Conveniently abstracted. Using the cache is like calling the content-producing function with a different syntax. For example function(arg) is replaced with pressflow_preempt('function', arg), which returns what function() would normally return. There is no explicit sense of cache_get and cache_set. This makes using Preempt more like using function calls than explicit cache operations.
  • Self-tuning. If a cached function runs longer than a given threshold, PressFlow Preempt will rebuild the cache of that function's output during cron instead of while a page is loading. Preempt also tracks usage of cached items and will only preemptively update cached results that the system is using.
  • Preemptive. Based on the performance data Preempt collects, it may choose to rebuild cached items during cron operations.
  • Amortized. Long-running operations like preemptive cache updates are amortized over multiple cron jobs to avoid hitting script execution limits. When cache cleanup is implemented, it too will be amortized.
  • Informative. Authorized users see information about whether items on the page were loaded from cache, and if so, when the cache was last updated. Preempt also informs the function being cached whether it is generating its content in the context of a disabled, live, or preemptive cache. These functions are invited to prefix their queries to indicate such status. That way, a quick view of current connections and jobs on the DB server indicates whether the long-running queries are being cached.
  • Modular. Modules supporting Preempt can easily test for a Preempt installation and choose to either call the cache-able function directly or through pressflow_preempt(). There's very little change necessary in the code. This way, modules can support Preempt without depending on it.

Development roadmap

  • Version 1.1
    • Cache invalidation
    • Stale item cleanup (stale items are currently just ignored except for retaining performance metrics)
    • Replace notices with a cache toolbox block providing invalidation of cached items and statistics for the current page and the entire site
  • Version 1.2
    • Support for n-parameter functions
    • Automatic support for state restoration, including the $_GET array, during cron runs
    • Automatic support for side-effects, including drupal_add_js()

Credits

Development of this module is sponsored by Four Kitchens.

Supporting organizations: 

Project information

Releases