Advertisement
rAthus

Force cache refresh of JS and CSS updates

Nov 4th, 2015
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Force cache refresh of JS updates by rAthus */
  2. live_updates_bottom_script_obj = document.createElement('script');
  3. live_updates_bottom_script_obj.type = 'text/javascript';
  4. live_updates_bottom_script_obj.src = 'http://example.com/api/live_updates/update.js?ts='+(new Date()).getTime();
  5. $('head').append(live_updates_bottom_script_obj);
  6. /* Force cache refresh of CSS updates by rAthus */
  7. live_updates_bottom_styles_obj = document.createElement('link');
  8. live_updates_bottom_styles_obj.type = 'text/css';
  9. live_updates_bottom_styles_obj.rel = 'stylesheet';
  10. live_updates_bottom_styles_obj.href = 'http://example.com/api/live_updates/update.css?ts='+(new Date()).getTime();
  11. $('head').append(live_updates_bottom_styles_obj);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement