Why my browser keeps loading old version of custom JavaScript files in \divi\js? [closed]

First get datetime stamp of your js file’s last modification, and use it as fourth parameter of wp_enqueue_script function:

$path="full path to your script file");
$handle="your_handle"; 
$src="https://wordpress.stackexchange.com/questions/283374/path of the script, relative to the WordPress root directory";
$depts = array(); // dependencies, if any
$ver = filemtime($path);
$in_footer = false;

wp_enqueue_script($handle, $scr, $depts, $ver, $in_footer);

If the datetime stamp changes, your updated script will be loaded, otherwise the cached script will be loaded.

Leave a Comment