This is a feature request to add support for 'Boost' module: http://drupal.org/project/boost

Expected result is to clear the Boost's page cache when the theme change. Find attached mockup to see suggested feature location. What do you think?

Currently Themekey works really well and smooth. But if a page is cache by the 'Boost' module Themekey module doesn't work at all. This is because Boost display a cached page and theme. 5,000+ sites are using Boost.

Any volunteer for a patch? I would be happy to contribute testing.

Comments

francewhoa’s picture

StatusFileSize
new396 bytes
new55.04 KB

mikeytown2’s picture

Subscribe for tracking purposes.
If you can use something like domain access to set a different theme per domain that would be ideal.
Does themekey work with the core page cache?

How does theme key keep track of the user selection?
Code that might be useful depending on how the user selection is tracked.
http://drupal.org/node/646228#comment-2320296

Edit: Francewhoa, Can you describe in detail what you wish would happen and what happens in reality?

francewhoa’s picture

Thanks for asking mikeytown2. I'm happy to clarify.

Here is a scenario that describe in detail what I wish would happen.

  1. Boost module is activated. Under admin/settings/performance/boost Boost's HTML - Default maximum cache lifetime is set to 1 week.
  2. Under admin/settings/themekey/properties Themekey Theme Switching Rule Chain is set to switch to the following themes.
    Garland on Monday
    Pushbutton on Tuesday
    And so on with a different theme every day.
  3. On Monday the anonymous visitor goes to the site. Garland is display.
  4. On Tuesday the anonymous visitor goes back to the site. Pushbutton is display. This is what I wish :)

I tried above scenario but it doesn't work when Boost is activated. It does work when Boost is deactivated though.

When Boost is activated what happen in reality is at step 4 Garland theme is display. What I wish is display Pushbutton on Tuesday to anonymous users.

Let me know if you have any other questions.

francewhoa’s picture

To try to isolate the source of the issue I did two tests using above scenario in #3. Both with Boost activated. Here are the results.
Test 1: If the 'content' of a page is updated then Boost clear its cache. Then the updated page content is display. And the theme is switch. Boost already does that very well :)
Test 2: If the 'content' of a page is NOT updated then Boost does NOT clear its cache. This is normal and expected. But the issue is that the theme does NOT switch.

So it seems that current Boost is able to detect when the content of a page is updated. But NOT able to detect when Themekey switch the page's theme.

mkalkbrenner’s picture

Status: Needs review » Active

The problem described here is not specific to boost. It also affects drupal's internal page cache, varnish, memcache and anything else that works as a page cache for anonymous users.

In think the only reliable way to automatically clear the page cache is hook_cron().

I'm not yet sure if we should do some magic depending on the time based themekey properties. Maybe if it's a better approach to keep that independent from the the switching rules and clear the cache every hour, day, week or a special date like 2010-12-24 00:00:00.

I put this on the ToDo list ...

francewhoa’s picture

Thanks mkalkbrenner.

I'm not a coder so I'll let others handle it. Any volunteer for a patch? I'll be happy to contribute testing and documentation.

mkalkbrenner’s picture

Version: 6.x-2.0 » 6.x-3.x-dev
Assigned: Unassigned » mkalkbrenner

Better compatibility to caches will require some more changes to ThemeKey. So I move this issue to ThemeKey 6.x-3.0 where we'll have the chance of alpha and beta releases.

mkalkbrenner’s picture

Title: Support for 'Boost' module » Support for page caches (internal and external like 'Boost')
mkalkbrenner’s picture

Status: Active » Needs work

ThemeKey 6.x-3.x-dev now clears the page cache (using the quick truncate method) every time you modify the theme switching rule chain. That already fixes the problem for some use cases but not for time based properties like Francewhoa described.

mkalkbrenner’s picture

Status: Needs work » Needs review

These features are included in ThemeKey 6.x-3.0-alpha1

  • fast deletion of page cache after modifications to Theme Switching Rule Chain
  • fast deletion of page cache after modifications to user profile theme setting
  • wildcard deletion of page cache after modifications to path alias theme setting
  • introduced classification of page cache support for themekey properties
  • introduced themekey cron to clean up page cache depending on rules containing time based properties

Please test this release and provide some feedback especially with external caches like boost or varnish.

francewhoa’s picture

Awesome. Thanks mkalkbrenner :) I'll test for Boost then post my result here.

mkalkbrenner’s picture

ThemeKey 6.x-3.0-alpha1 contained a critical bug that cause most of the properties not to work. So please try ThemeKey 6.x-3.0-alpha2.

francewhoa’s picture

Ok. Thanks for letting us know :)

francewhoa’s picture

Version: 6.x-3.x-dev » 6.x-3.0-alpha2
Status: Needs review » Needs work
StatusFileSize
new99.47 KB
new96.62 KB
new493.34 KB
new165.15 KB
new24.98 KB
new32.6 KB

I tested ThemeKey 6.x-3.0-alpha2 but issue is still present. I tested various configurations with Boost and Themekey but same results as #3.

Tested with:
*ThemeKey 6.x-3.0-alpha2
*Boost 6.x-1.18
*Drupal 6.16 fresh install

I noticed that admin/reports/updates and admin/build/modules both display ThemeKey Properties 6.x-2.0. Is this normal? Find screenshoots to clarify (admin-reports-updates.png and admin-build-modules.png)

Find other attached screenshoots to clarify Themekey and Boost's settings.

mkalkbrenner’s picture

Status: Needs work » Needs review

You need to install ThemeKey Properties 6.x-2.1 which supports the cron introduced in ThemeKey 6.x-3.0.

Lloyd’s picture

I know this is a tough question to answer, but how stable is 6.x-3.0? I'm going to be installing this on a site for the first time. Boost is in use so I'm intriguted with this new version. I know that there's no guarantee that things will work as expected, but would you yourself install this version on a production site at this point?

Thanks for making this module. In about 30 seconds of googling I found this perfect solution to a problem I just found out about.

mkalkbrenner’s picture

Version: 6.x-3.0-alpha2 » 6.x-3.0-alpha3

@ #16 Lloyd:
Unlike some other contrib developers I'm releasing alphas, betas and release candidates if I change something in the architecture of a module.
In this case the architectural change is not that big and 95% of the code is identical with ThemeKey 6.x-2.x. According to the usage statistic 17 sites are already using ThemeKey 6.x-3.x.
As soon as someone confirms that this issue is fixed I will declare ThemeKey 6.x-3.0 as beta for some time and wait if someone runs into a bug.

So from my point of view the development phase of ThemeKey 6.x-3.0 is done and you can give it a try.

Lloyd’s picture

Perfect answer. I've got it installed, so far no issues. Thanks.

mkalkbrenner’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

francewhoa’s picture

Version: 6.x-3.0-alpha3 » 6.x-3.0

Confirming that ThemeKey 3.0 fixed the issue with Boost cached pages. Thanks all :)

If ThemeKey isn't working then ensure your cron run frequently enough. There is a friendly reminder about that at /admin/settings/themekey at the top of the page in a yellow box. In other words the theme will be change only on cron run.

Tested using
*ThemeKey 6.x-3.0
*ThemeKey Properties 6.x-2.3
*Boost 6.x-1.18
*Drupal 6.19