Answer the question
In order to leave comments, you need to log in
Very long site update on Chrome?
I noticed a long time ago that any change with the site apart from the control panel, when working directly with the code, updates the page for a very long time (about two days) when the updated data is loaded. This problem is only with Chrome browser. Although if you delete your browsing history, everything is ok. Is there a way to make it so that any code changes (not in the control panel) will update the pages as quickly as in other browsers?
Answer the question
In order to leave comments, you need to log in
As far as I understand, the question is about css and js files.
You can change the version of the file after the changes, then it will be updated in the browser cache.
or do it automatically by adding wrappers and including files using them
function enqueue_versioned_script( $handle, $src = false, $deps = array(), $in_footer = false ) {
wp_enqueue_script( $handle, get_stylesheet_directory_uri() . $src, $deps, filemtime( get_stylesheet_directory() . $src ), $in_footer );
}
function enqueue_versioned_style( $handle, $src = false, $deps = array(), $media = 'all' ) {
wp_enqueue_style( $handle, get_stylesheet_directory_uri() . $src, $deps = array(), filemtime( get_stylesheet_directory() . $src ), $media );
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question