Sign Static Files in Magento2

Sign Static Files in Magento2
  • This Option is mainly helpful to detect the latest (or updated ) code by browser.
  • Based on the Expire (header) limit of the HTTP request,browser will remove the expired JS,CSS,Font,Image’s & it will reach the latest version of file .
  • It allow invalidate the browser cache for JS , CSS, Font, Images.
  • If you enable this option, system will append Version or signature into base URL of the Images, JS , CSS and Font URL’s.
  • Ex: BaseURL/pub/static/<VERSION>/myJS.js
  • Whenever we run the static deploy content, then system will regenerate new version for each URL. So automatically browser will understand & browser will remove the expired headers and it will read automatically updated files and it maintain in cache. Until and unless clear the cache browser will read that old one.
How to enable:
Admin – Stores – Configuration – Advanced – Developer – Static Files Settings – Yes/No
Important: This option will work only on Developer Mode.

Leave a Reply