as per subject :)

CommentFileSizeAuthor
#8 boost-326683.patch1.37 KBmikeytown2

Comments

Arto’s picture

Title: How to increase cache lifetime to more than 1 day, like a week for example? » Increasing cache lifetime beyond presets
Assigned: Unassigned » Arto

Hi Giorgio,

You can either hack the code (it's in boost.admin.inc), or you can execute the following command against your database:

UPDATE variable SET value = 's:6:"604800";' WHERE name = 'cache_lifetime';

The above sets the cache lifetime to a week (7 * 24 * 60 * 60 seconds). Of course, since it's beyond the range of the preset options on the settings screen, the next time you save the performance settings you might have to manually execute this again to correct the lifetime.

I'll see about including longer cache lifetimes to the 6.x branch that is currently under active development.

giorgio79’s picture

Thanks Arto. I tried it, but it seems increasing it beyond 1 day does not work.

After trying your suggestion the expiry date always equaled the cache date at the bottom of the html.

giorgio79’s picture

I was just checking the boost.admin.inc, and I believe this is the relevant code but I have not found where the form is pulling the available values...

  $lifetime = &$form['cache_lifetime'];
  $lifetime['#description'] = t('On high-traffic sites it can become necessary to enforce a minimum cache lifetime. The minimum cache lifetime is the minimum amount of time that will go by before the cache is emptied and recreated. A larger minimum cache lifetime offers better performance, but users will not see new content for a longer period of time.');
  unset($form['cache_lifetime']);
  $form['cache_lifetime'] = &$lifetime;
mo6’s picture

subscribe

mo6’s picture

Status: Active » Needs review

You can't see the form presets because they are defined in modules/system/system.module.

I've created a small patch to boost.admin.inc:

26a27,31
> 
>   $period = drupal_map_assoc(array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400, 2*86400, 3*86400, 7*86400), 'format_interval');
>   $period[0] = t('none');
>   $form['cache_lifetime']['#options'] = $period;
> 

This adds "2 days, 3 days and 1 week" to the caching lifetime options.

Terko’s picture

Hello!
How I can increase the cache lifetime from 24 hours to for example 30 hours? I am using the 6.x dev version. I will be very happy if you help me, because 24 hours is not enough for my web site and the load is heavy for my hosting. Thanks!

mikeytown2’s picture

Version: 5.x-1.0 » 6.x-1.x-dev
Assigned: Arto » Unassigned
Category: support » feature
Status: Needs review » Active
mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new1.37 KB
giorgio79’s picture

mikeytown2’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

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