After OJS Theme Change , Need to Clear Brower Cache

I have to clear my browser’s cache in order to see changes whenever I change the theme in my Pkp ojs. version 3.3.0.19
See a example after theme change

before clear browser caches

after clear browser cache

Note: i happend not only with me, but also every visitor. so, it’s not possible tell every visitor to clear their browser caches.

And I have clear caches with in PkP ojs Administration setting, but i didn’t work

There are two things you can do:

  1. delete the cached CSS of the themes on your OJS installation:
cd {ojs_root}/cache
rm -rf *.css

This forces the LESS processor to recreate the CSS of the theme(s).

  1. Force the browser to reload the CSS by way of the Apache configuration

Add the following lines to your Apache configuration for a journal (preferably at the end of your <VirtualHost> section):

        # UZH CHANGE FOR CACHING-CONTROL WHILE REDESIGN
        # No caching for CSS if changes where made (max 1 week)
        # No caching for CSS if changes where made (max 1 week)
        # so enduser gets all actual changes by force
        # - last turn off cache (comment in  lines): 2021/11/11/mb
        # - last turn on  cache (comment out lines): -
        <filesMatch "\.(css)$">
                ExpiresDefault A0
                Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
                Header set Pragma "no-cache"
        </filesMatch>
        # UZH CHANGE FOR CACHING-CONTROL WHILE REDESIGN - END

This makes sense mostly when you often do changes to a theme.

I am using shared hosting. there is any solution for it?

i have tried following below instructions, but it didn’t worked.

https://www.keycdn.com/blog/http-cache-headers