Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-15710

Improve versioning of assets and .css files


    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.3
    • Fix Version/s: None
    • Component/s: Other, Styles
    • Labels:


      In phpBB, asset and .css files are cached by the user's browser.  If one or more of these files is updated and the browser cache not cleared, there can be various problems with the correct display of phpBB sites.  This applies to phpBB updates, style updates and sometimes extension updates.

      In phpBB there is a system that attempts to solve this problem by appending a versioned query to the asset or .css url (e.g.: /styles/prosilver/theme/stylesheet.css?assets_version=343).  This method does not work for files loaded via .css stylesheets.  Currently after a site upgrade the only way to get all of the current files is for each user to perform a manual cache clear.  On PCs this is easy (ctrl-f5), but on mobile devices the procedure is varied and often difficult for some forum users, leading to frustration and complaints.

      I have written a patch for phpBB that implements and alternate method of versioning assets and .css files by versioning the directory names (e.g.:/styles/prosilver/theme.199/stylesheet.css).  This method is more general and works with stylesheets.  It does rely on the availability of mod_rewrite on the http server, but in cases where that is not available, falls back to the previous system.

      The patch also updates the prosilver style to take advantage of the improvement.  The patch will not break any other existing styles or extensions, but they may require some minor updates to get the full benefit.


          Issue Links



              • Assignee:
                v12mike v12mike
              • Votes:
                0 Vote for this issue
                4 Start watching this issue


                • Created: