Forum Discussion
VIN_Support_890
Nimbostratus
Sep 18, 2015Looking to force a JavaScript refresh through iRule
Admitted newbie here, so feel free to "explain it to me like I am 5".
Instead of adding a random querystring name/value pair to our JS files in our web pages to force a refresh from the web server,...
cjunior
Nacreous
Sep 22, 2015First, you need to set up a stream profile in the VS, then, set up this iRule:
when HTTP_REQUEST {
STREAM::disable
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
if { [HTTP::header "Content-Type"] contains "text" } {
This code will create a random number and append query string to the original source file.
STREAM::expression "@global/js/alertnotificationmanager.js@global/js/alertnotificationmanager.js?rand=[expr rand()]@"
STREAM::enable
}
}
I think this should work! 🙂 Regards.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects