Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-10932

Conditional get support for stylesheets

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.2, 1.9
    • Fix Version/s: 2.0
    • Component/s: Themes
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Today the stylesheets generated by individual themes set an Expires header which allow them to be fetched directly from the cache until expiry. However when the cache expires they have to be refetched, even if they haven't changed. This usually means about 100kB (20kB if compressed) unneeded network traffic every ten minutes.

      I've provided a patch that implements conditional get. If the stylesheets haven't been modified since they were last requested, only a 403 Not Modified response is provided.

      For this to work, the style_sheet_setup function should no longer be called with time() as the first argument, from the individual styles.php-files in the themes.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                samhemelryk Sam Hemelryk
                Reporter:
                nilinili Nicklas Lindgren
                Tester:
                Nobody
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  24/Nov/10