Under heavy cache conditions, updating the parent theme don’t reflect changes with child theme enabled

You could use the file modification time (filemtime) to trigger a reload (and recache) of the file.

This is how I usually enqueue styles (and scripts):

$file="/css/some-styles.css";
wp_enqueue_style(
    'some-styles',
    get_stylesheet_directory_uri().$file,
    array('some-dependency'),
    filemtime(get_stylesheet_directory().$file)
);

This results in something like the following:

<link rel="stylesheet" id='some-styles-css'
    href="https://wordpress.stackexchange.com/questions/130821/.css/some-styles.css?ver=1388657898" type="text/css" media="all" />

You would have to do this for both the parent and the child theme, though.

Leave a Comment