← Back to team overview

mahara-contributors team mailing list archive

[Bug 1558387] [NEW] Use $CFG->cacheversion for HTMLPurifier revision number

 

Public bug reported:

As is the recommended practice, Mahara caches the computed form of its
HTMLPurifier rules, for performance. We have in place in clean_html() a
setting for "HTML.DefinitionID", with a comment that says that the
developer should increment that number if they make changes to the HTML
Purifier definition. But in the past we have *not* done that, and
instead manually deleted the htmlpurifier cache directory from the
dataroot.

It occurs to me that it would be simpler to set HTML.DefinitionRev to
"get_config('cacheversion')", so that it will be automatically cleared
whenever the Mahara system version changes. The a dev just needs to bump
version.php to make the HTMLPurifier cache get cleared.

This will cause the cache to be cleared more frequently than it needs to
be (we rarely make changes to our HTMLPurifier configuration), but only
once per Mahara upgrade, so that's still not too bad.

** Affects: mahara
     Importance: Low
         Status: In Progress

** Affects: mahara/1.10
     Importance: Low
         Status: In Progress

** Affects: mahara/15.04
     Importance: Low
         Status: In Progress

** Affects: mahara/15.10
     Importance: Low
         Status: In Progress

** Affects: mahara/16.04
     Importance: Low
         Status: In Progress


** Tags: cache htmlpurifier

** Also affects: mahara/15.04
   Importance: Undecided
       Status: New

** Also affects: mahara/16.04
   Importance: Undecided
       Status: New

** Also affects: mahara/1.10
   Importance: Undecided
       Status: New

** Also affects: mahara/15.10
   Importance: Undecided
       Status: New

** Changed in: mahara/1.10
   Importance: Undecided => Low

** Changed in: mahara/15.04
   Importance: Undecided => Low

** Changed in: mahara/15.10
   Importance: Undecided => Low

** Changed in: mahara/16.04
   Importance: Undecided => Low

** Changed in: mahara/16.04
       Status: New => In Progress

** Changed in: mahara/15.10
       Status: New => In Progress

** Changed in: mahara/15.04
       Status: New => In Progress

** Changed in: mahara/1.10
       Status: New => In Progress

** Changed in: mahara/1.10
    Milestone: None => 1.10.9

** Changed in: mahara/15.04
    Milestone: None => 15.04.6

** Changed in: mahara/15.10
    Milestone: None => 15.10.2

** Changed in: mahara/16.04
    Milestone: None => 16.04.0

** Tags added: cache htmlpurifier

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1558387

Title:
  Use $CFG->cacheversion for HTMLPurifier revision number

Status in Mahara:
  In Progress
Status in Mahara 1.10 series:
  In Progress
Status in Mahara 15.04 series:
  In Progress
Status in Mahara 15.10 series:
  In Progress
Status in Mahara 16.04 series:
  In Progress

Bug description:
  As is the recommended practice, Mahara caches the computed form of its
  HTMLPurifier rules, for performance. We have in place in clean_html()
  a setting for "HTML.DefinitionID", with a comment that says that the
  developer should increment that number if they make changes to the
  HTML Purifier definition. But in the past we have *not* done that, and
  instead manually deleted the htmlpurifier cache directory from the
  dataroot.

  It occurs to me that it would be simpler to set HTML.DefinitionRev to
  "get_config('cacheversion')", so that it will be automatically cleared
  whenever the Mahara system version changes. The a dev just needs to
  bump version.php to make the HTMLPurifier cache get cleared.

  This will cause the cache to be cleared more frequently than it needs
  to be (we rarely make changes to our HTMLPurifier configuration), but
  only once per Mahara upgrade, so that's still not too bad.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1558387/+subscriptions


Follow ups