Skip to content

Commit

Permalink
🐛 FIX: Cache Buster Updates Properly
Browse files Browse the repository at this point in the history
Reset cache buster within loop so it updates properly
  • Loading branch information
taija committed Jun 12, 2020
1 parent 01881d7 commit 9733186
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions js/rave-alert-ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@


jQuery( document ).ready( function( $ ) {
// Get minutes of current time for cache busting
var current_time = new Date();
var current_minutes = current_time.getMinutes(); // Should be a number, like 12, or 59
(function callAjax() {

// Get minutes of current time for cache busting
var current_time = new Date();
var current_minutes = current_time.getMinutes(); // Should be a number, like 12, or 59
$.ajax({
method: 'GET',
url: rest_php_variables['rest_url'] + '?' + current_minutes,
Expand Down
4 changes: 2 additions & 2 deletions rave-alert-notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://github.com/BellevueCollege/rave-alert-notification
Description: Sends Rave Alert notification to Bellevue College WordPress sites.
Author: Bellevue College IT Services
Version: 1.7.3
Version: 1.7.4
Author URI: https://www.bellevuecollege.edu
GitHub Plugin URI: bellevuecollege/rave-alert-notification
*/
Expand Down Expand Up @@ -40,7 +40,7 @@ function enqueue_ajax() {
open_message_class: "' . addslashes(stripslashes($open_message_class)) . '",
is_homepage: "' . $is_homepage . '"
};';
wp_enqueue_script( 'rave-alert-ajax', plugin_dir_url( __FILE__ ) . 'js/rave-alert-ajax.js#asyncdeferload', array('jquery'), '1.7.3', true );
wp_enqueue_script( 'rave-alert-ajax', plugin_dir_url( __FILE__ ) . 'js/rave-alert-ajax.js#asyncdeferload', array('jquery'), '1.7.4', true );
wp_add_inline_script( 'rave-alert-ajax', $rest_variables, 'before' );

}
Expand Down

0 comments on commit 9733186

Please sign in to comment.