3

Whenever I make changes css or anything I have to ask the client to clear cache to view the changes same for me.

Any advise on how to deal with this.

Magento 2.

  • remove cache and page cache folders from var directory. – Dinesh Yadav Nov 22 '17 at 13:04
1

You could try using versioning for css and js.

This option can be enabled in the:

`Stores` ->
    `Configuration` ->
        `Advanced` ->
           `Developer` ->
              `Static Files Settings` ->
                  `Sign Static Files` ->
                      `Yes`

This option adds a timestamp to js and css files and it allows to invalidate cache in the client's browser.

After enabling this option and flushing cache from admin panel or CLI, your files will look like:

domain.name/pub/static/version1511443406/frontend/Magento/luma/en_US/css/print.css

instead of

domain.name/pub/static/frontend/Magento/luma/en_US/css/print.css

So the difference in the version1511443406 part.

| improve this answer | |
0

This is not a real solution but can be something helpful for you. The change which you are doing in your CSS, you will need to do the same change in pub/...css file. Because this is the file which actually gets rendered.

Not Sure if this will actually solve your problem, but will possibly be a way out to your issue.

| improve this answer | |
  • but isnt the issue the client browser's cache? coz we are in production mode the static files should update I guess or I might be wrong. – Wissam Yamout Nov 22 '17 at 13:25
  • The way to check that is to track if the client see your css changes in view source? And is the pub file getting deployed has your changes – dev_67Commerce Nov 22 '17 at 13:28
  • aha ok will try to ask customers... I wonder how big companies handle that... there must be some kind of mod expiration on cache or something – Wissam Yamout Nov 22 '17 at 13:32
  • You can check that in a different machine with different location – dev_67Commerce Nov 22 '17 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.