public static String makeIECachingSafeUrl ( String url , long unique ) { if ( url . contains ( "timestamp=" ) ) { return url . replaceFirst ( "(.*)(timestamp=)(.*)([&#].*)" , "$1$2" + unique + "$4" ) . replaceFirst ( "(.*)(timestamp=)(.*)$" , "$1$2" + unique ) ; } else { return url . contains ( "?" ) ? url + "&timestamp=" + unique : url + "?timestamp=" + unique ; } }
Makes new unique URL to avoid IE caching .