Moodle

consider changing $lifetime = 600 in /theme/standard/style.php to 260000.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.7, 1.8, 1.9, 1.9.2, 2.0
  • Fix Version/s: 2.0
  • Component/s: Themes
  • Labels:
    None
  • Affected Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

Since most style sheets inherit this value, the stylesheet is not cached effectively between sessions and in fact probably gets redownloaded several times in a session. As the current standard stylesheet is about 125K, for a busy site, this can add 10's or even 100 megabyes per hour to the traffic and makes initial loggins slow, especially for slow connections like satellite and dialup. In addition, it has a large impact on sites which try to compress their traffic as compressing 125K for many simultaneous users is not a trivial computation task when done "on the fly", so this increases CPU load for those sites..

260,000 seconds is a little more than 3 days and ensures that changed themes will go into effect. But the very low existing setting seems only helpful during the theme development and change process. Perhaps there is a reason for it, but I can't think of one.

As a side note, on both IE and Firefox, it seems that CSS files that have extensions of .php get reloaded when a page is reloaded, significantly increasing the bandwidth (especially since many people will reload a page when a site gets slow to see if that helps). With extensions of css, one needs to hold down the control key while refreshing unless the cache has expired. I am not recommending changing this as there are other implications that need to be studied, but from my experience, the $lifetime variable should be changed and will help site performance and user experience.

Activity

Hide
Tim Hunt added a comment -

This was dealt with in Moodle 2.0.

Show
Tim Hunt added a comment - This was dealt with in Moodle 2.0.

People

Vote (1)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: