I am creating plugin for first time and facing major issue regarding cache.
I register my js files as
wp_register_script("custom-js-backend", PLUGIN_URL . 'assets/js/custom.js', array(
'jquery',
'jquery-blockui'
));
wp_enqueue_script("custom-js-backend");
But unable to reflect changes on admin panel.
Tried
function cache_cleanup()
{
remove_action('wp_head', 'wp_generator');
remove_action('wp_footer', 'wp_generator');
}
add_action('init', 'cache_cleanup');
Also defined in wp-config.php
define('WP_CACHE',false);
But no luck.
Since by default my js file comes with 5.1.0 version so tried to remove the version from it using https://wordpress.org/plugins/disable-version-caching/
Now the version is being removed but still file is not updating.
One solution is adding version number to my js file and changing version after every small change but this is quite not right.
Any help how to disable cache for admin panel while creating plugin.