WordPress Browser Cache Issues

3d Animation

To help stop browsers storing the cached CSS file (style.css) – add the following code to the functions.php file in the child theme of your WordPress installation. This should force the browser to load the CSS file each time it’s updated. You also need to make sure the style sheet isn’t loaded in the header.php file separately. If you’re using SiteGround also ensure you’ve installed their SG Optimizer plugin and the cache has been purged.

add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
	wp_enqueue_style('main-styles', get_template_directory_uri() . '/style.css', array(), filemtime(get_template_directory() . '/style.css'), false);