• Resolved sanumolu5

    (@sanumolu5)


    Hi,

    I have recently installed W3 Total Cache plugin. It is working fine. But when I make changes in the backend. For ex:- I have a custom plugin that I created and I am using document.write() in a javascript function to display time on the frontend. I comment that line (document.write()) in order to work “with Edit with elementor” for that page. Ideally, this should not display time on the frontend. But the changes are not reflecting even after purging all caches, deleting browser caches. And when I deactive W3 Total Chache, immediately the changes are reflecting.

    Similarly, the time doesn’t immediately show up after uncommenting document.write() and purging all caches. I have to deactivate the plugin to show up changes.

    How can I fix this issue? Obviously I cannot go on deactivating and activating for changes to reflect. There is definitely some core problem that needs to be fixed. Please help in this regard.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @sanumolu5

    Thank you for reaching out and I am happy to assist you with this.

    Can you please share if you are using a Proxy cache – some other form of caching like Server side or Nginx proxy? And if so have you also purged this as well?
    Can you also please share the screenshot of where the time should appear?

    Thanks!

    Thread Starter sanumolu5

    (@sanumolu5)

    @vmarko

    Thank you for your reply and offer to help.

    We are not using any other cache like server-side or proxy cache.

    Please refer to the screenshot where time is supposed to be displayed for one class. Similarly for all classes time has to be shown at the similar place.

    https://www.awesomescreenshot.com/image/39753095?key=27d01cfe39c39ae2c129ca846210e8f0

    Thread Starter sanumolu5

    (@sanumolu5)

    Hi,

    The document.write() that I am using to output time on the frontend is not working at all since W3 Total cache is enables.

    Also I am facing the issue with W3 Total Cache in another website too. The css changes that I am making are not reflecting on the front end, even after doing purge all caches.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @sanumolu5

    Can you please disable the settings one by one in Performance>general settings, save the settings and purge the cache after each setting is disabled and see which one might be causing the issue?

    Thanks!

    Thread Starter sanumolu5

    (@sanumolu5)

    @vmarko

    Disabling Minify CSS and JS made it work. Please see the screenshot.

    https://www.awesomescreenshot.com/image/39780642?key=e02561ce3210374b6d6bfc124e21cae1

    Please guide me through a solution to make it work with minify enabled. Otherwise there won’t be much use of using this plugin. Are there any filters etc.. that need to be included in Themes/functions.php to exclude my custom plugin which has javascript code?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @sanumolu5

    Thank you for your feedback. Can you please share the URL/path of your js file?

    It seems that the problem is in the fact that the content of the file is changed, however, the file name remained the same, and it’s still cached with Browser cache for js files.

    We do, however, have an option for that and it’s called “Prevent caching of objects after settings change” in?Performance>Browser?Cache.
    You can set this option globally, or set it for the individual file types (HTML&XML, JS&CSS, Media&Other files).
    What this option does is add a query string to a resource –??xNNNNN
    How this works in your case:
    1. Minify is enabled and the files are cached:
    https://yourwebsite.com/wp-content/cache/minify/02dfe.js
    2. Enable “Prevent caching of objects after settings change” in?Performance>Browser Cache, under the?CSS/JS?section, save all settings, and purge the cache.
    3. If you check the website after that, you will see that the existing minified file has a random query string at the end:
    https://yourwebsite.com/wp-content/cache/minify/02dfe.js?xNNNNN
    4. The browser will fetch a new file version as it does not have the file with the query string cached.
    5. If you make any changes in JS or CSS that are minified (or not), once the changes are done, go to either Performance>Browser Cache, or Performance>Minify and click on the Update Media query string button, just above the General sub-box, and make sure to save all settings and purge the cache after that

    Let me know if this helps. And if not, please try to exclude the file from the JS minify in Performance>Minify>Never minify the following JS files.

    I believe in your case it would be /wp-content/plugins/my-custom-hooks/assets/js/custom-date-scripts.js

    Thanks!

    Thread Starter sanumolu5

    (@sanumolu5)

    @vmarko

    Here is the url for my custom js file

    https://staging59.courses.jkyog.org/wp-content/plugins/my-custom-hooks/assets/js/custom-date-scripts.js?ver=6.2

    get_client_time() function is supposed to show time on UI.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @sanumolu5

    Thank you for your feedback. As I can see you followed the instructions and enabled the Prevent caching of objects after the settings change option. As I can see the time is showing now as expected.
    Can you please confirm this?

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Issue with W3 Total Cache plugin’ is closed to new replies.