Opened 10 years ago
Closed 10 years ago
#13099 closed defect (fixed)
[CLA][PATCH] cacheBust does not work after AMD refactor
Reported by: | liucougar | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Core | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
here is a patch to bring it back:
-
dojo.js
902 902 if(has("dojo-sync-loader") || has("dojo-gettext-api")){ 903 903 var getText = req.getText = req.getText || function(url, async, onLoad){ 904 904 var xhr = getXhr(); 905 if(req.rawConfig.cacheBust){ 906 //Make sure we have a string before string methods are used on uri 907 url += ""; 908 url += (url.indexOf("?") == -1 ? "?" : "&") + String(req.rawConfig.cacheBust).replace(/\W+/g,""); 909 } 905 910 if(async){ 906 911 xhr.open('GET', url, true); 907 912 xhr.onreadystatechange = function(){
it would be better if the 'replace(/\W+/g,"")' part only run once and it's set to replace the original cacheBust (so no need to do the replace every time getText is called). but I don't know how to do that properly
Note: See
TracTickets for help on using
tickets.
(In [25280]) r/r requirejs config variable urlArgs with dojo config variable cacheBust; fully implement; thanks liucougar; fixes #13099; !strict