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!
@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
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.
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!
@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?
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!
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!