Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

q2a - Clear CSS cache from browser with CSS versioning

0 votes
25 views
added Dec 18, 2020 in Software & tools by lcjr Second Warrant Officer (3,760 points)

Question2Answer script does not cache the CSS, browser does. In order to clear it, you need to add versioning into the CSS.

  1. You need to edit the following file; root/qa-include/qa-theme-base.php line 316 (v.1.7.2). 
  2. Comment the first code and add the CSS versioning as shown below;
    1. // return 'qa-styles.css?'.QA_VERSION;
      
      return 'qa-styles.css?v=2.1';
  3. Apply changes to your .css, and update root/qa-include/qa-theme-base.php to the server. 
  4. Inspect element to double check the changes is in effect.
    1.  <link rel="stylesheet" href="./qa-theme/YOUR_THEME/qa-styles.css?v=2.1">
      

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...