Answer the question
In order to leave comments, you need to log in
How to force refresh site user's cache (wordpress)?
Hello. Faced such a problem. I make changes to the styles on any pages of the site, I update the page. The changes do not take effect until I refresh the page via ctrl+f5 or clear the site cache with the plugin (WP Super cache).
Previously, the plugin saved, but now, no matter how I try to clear the cache, nothing helps except ctrl + f5.
The bottom line is, most users do not understand that they need to clear the cache and refresh the page via ctrl + f5 and when they enter the site, they see an ugly page with no styles or with old styles.
It is necessary to make it so that when entering the updated pages of the site, without ctrl + f5, the user immediately sees the updated version of the page.
Here is what I tried:
1) On the hosting side, through the support service, disabled css file caching - it didn’t help (apparently the old cache remained with users)
2) Deleted the cache a thousand times using the WP Super Catch plugin - it didn’t help
3) In the WP php file in which the main file is connected styles, added "?ver=123" to this file - did not help.
Here's what it looked like:
It was:
wp_enqueue_style('main', get_template_directory_uri() . '/css/emmet-style.min.css', array(
'bootstrap',
'font-awesome'
), mp_emmet_get_theme_version(), 'all');
wp_enqueue_style('main', get_template_directory_uri() . '/css/emmet-style.min.css?ver=777', array(
'bootstrap',
'font-awesome'
), mp_emmet_get_theme_version(), 'all');
mp_emmet_get_theme_version(), 'all');
Answer the question
In order to leave comments, you need to log in
And the console (f12) shows you on the Network tab what version of css? emmet-style.min.css?ver=777 ?
Or not?
Solved the problem.
Here in this code:
wp_enqueue_style('main', get_template_directory_uri() . '/css/emmet-style.min.css', array(
'bootstrap',
'font-awesome'
), mp_emmet_get_theme_version(), 'all');
mp_emmet_get_theme_version()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question