Context Cache is module which lets you control caching and expiration through Context. For example, for one content type you can set its cache for two hours while for another you can set it for 30 minutes.

The Drupal cache applies the same expiration time to all pages on a site, but with this module it can be customized by path, content type, taxonomy, and other conditions. There are other related modules, but not like this one, such as http://drupal.org/project/boost_custom_expire_rules

Coder Sniffer will complain about the class name and the scope modifier, but these errors conflict with the standard way of writing Context plugins, so I did not make the changes. You can see these errors here: http://ventral.org/pareview/httpgitdrupalorgsandboxgeraldmelendez1975776git

Project page: http://drupal.org/sandbox/geraldmelendez/1975776

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/geraldmelendez/1975776.git context_cache

Reviews of other projects
http://drupal.org/node/1999064#comment-7434126
http://drupal.org/node/1997696#comment-7425228
http://drupal.org/node/1987190#comment-7413638

Comments

geraldmelendez’s picture

Issue summary: View changes

Improved grammar

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Issue summary: View changes

Fixed branch.

trof’s picture

Status: Needs review » Needs work

Hi geraldmelendez.
The module works perfectly.
Just a small correction:
context_reaction_cache.inc
line 47

      '#description' => (variable_get('cache', 0) ? '' : '* ') .
        'Page caching needs to be enabled in order to use "Internal", it is currently <strong>' .
        (variable_get('cache', 0) ? 'enabled' : 'disabled') . '</strong>, edit this in the ' .
        l(t('performance page'), 'admin/config/development/performance') .
        '. "Internal" controls Drupal\'s page cache and "External" sets the proper headers for an external cache, ' .
        'while "Disabled" disables page caching and sends strict headers to prevent caching (no-cache/must-revalidate).',

need add t() function to description

a.milkovsky’s picture

Please consider reviewing coding standarts.

FILE: /var/www/drupal-7-pareview/pareview_temp/context_reaction_cache.inc
--------------------------------------------------------------------------------
FOUND 10 ERROR(S) AFFECTING 8 LINE(S)
--------------------------------------------------------------------------------
11 | ERROR | Class name must begin with a capital letter
11 | ERROR | Class name must use UpperCamel naming without underscores
16 | ERROR | Method name "context_reaction_cache::options_form" is not in
| | lowerCamel format, it must not contain underscores
16 | ERROR | No scope modifier specified for function "options_form"
48 | ERROR | Array indentation error, expected 6 spaces but found 8
49 | ERROR | Array indentation error, expected 6 spaces but found 8
50 | ERROR | Array indentation error, expected 6 spaces but found 8
51 | ERROR | Array indentation error, expected 6 spaces but found 8
52 | ERROR | Array indentation error, expected 6 spaces but found 8
98 | ERROR | No scope modifier specified for function "execute"
--------------------------------------------------------------------------------

Test your module at http://ventral.org/pareview/httpgitdrupalorgsandboxgeraldmelendez1975776git after each update

geraldmelendez’s picture

Status: Needs work » Needs review

Hey guys, thanks for reviewing my module. I meant to work on it last night but I was stuck at work.

I made all the suggested changes except for one:
16 | ERROR | Public method name "ContextReactionCache::options_form" is not in
| | lowerCamel format, it must not contain underscores
http://ventral.org/pareview/httpgitdrupalorgsandboxgeraldmelendez1975776git

This is a Context hook, so the name of the function cannot be changed. The Context module uses this hook to pull in the configuration form.

trof’s picture

Status: Needs review » Reviewed & tested by the community

Hi geraldmelendez.

Probably Coder Sniffer say something like
104 | WARNING | Code after RETURN statement cannot be executed
in file context_reaction_cache.inc

But I think in this case the code is written correctly.

geraldmelendez’s picture

Hey trof,
I'm not seeing that error on my local server or on Ventral (http://ventral.org/pareview/httpgitdrupalorgsandboxgeraldmelendez1975776git)

I only get that one error from line 16

16 | ERROR | Public method name "ContextReactionCache::options_form" is not in
| | lowerCamel format, it must not contain underscores

Thanks for the quick reply,
- G

zterry95’s picture

context_reaction_cache.inc

Line 54

add t() for #description

geraldmelendez’s picture

Hey zterry95,
Thanks for reviewing my module, the description is already passed through a t() function on line 38:

$type_description = t('!starPage caching needs to be enabled in order to use "Internal", it is currently !status, edit this on the !link. "Internal" controls Drupal\'s page cache and "External" sets the proper headers for an external cache, while "Disabled" disables page caching and sends strict headers to prevent caching (no-cache/must-revalidate).', array(
        '!star' => variable_get('cache', 0) ? '' : '* ',
        '!status' => '<strong>' . (variable_get('cache', 0) ? t('enabled') : t('disabled')) . '</strong>',
        '!link' => l(t('performance page'), 'admin/config/development/performance'),
      ));

Line 54:

'#description' => $type_description,
soundessential’s picture

Works as described and has pretty clean code. Good work!

geraldmelendez’s picture

Thank you for testing.

geraldmelendez’s picture

Issue summary: View changes

Note about errors

geraldmelendez’s picture

Issue summary: View changes

Adding my reviews

geraldmelendez’s picture

Issue summary: View changes

Another review

soundessential’s picture

Issue tags: +PAreview: review bonus

Here's the review tag.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

manual review:
ContextReactionCache::options_form(): the #options label should run through t() also.

But otherwise looks good to go to me, so ...

Thanks for your contribution, geraldmelendez!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

geraldmelendez’s picture

Thank's a lot for reviewing my module and for updating my account. I can't wait to contribute more of my modules.

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

Anonymous’s picture

Issue summary: View changes

Adding my third review