Forum Discussion
Exception Rewriting javascript
Hello,
I have a application that load javascript on the APM with Portal Access and full patching. The application loads on the mobile devices and the loading is long, due to the rewriting of JavaScripts.
I believe this is due to the resource restrictions on the mobile devices to handle/process large content.
There are not links on the JavaScripts, then we do not need to patch it. I want to disable the rewrite for the JavaScripts
I create Irule:
when HTTP_RESPONSE {
if { [matchclass $my_uri_SAP contains my_uri_SAP] && [HTTP::header "Content-Type" ] contains "javascript"} {
REWRITE::disable
}
}
It's not working fine 😞
At which event flow APM, I must to insert the rewrite::disable ? Or disable the process of rewrite.
Thanks you in advance.
Best Regards,
- cjuniorNacreous
Hello, According to docs, I think you are doing it on the correct event (HTTP_RESPONSE).
https://devcentral.f5.com/wiki/iRules.REWRITE-disable.ashx
https://devcentral.f5.com/articles/http-event-order-access-policy-managerAs a first shot, I would try to change from URI check to lowercase PATH check comparision. (Put values on lowercase chars on data group too). And so, I discard "Content-Type" validation, since I set the full path I don't need rewrite.
https://devcentral.f5.com/wiki/irules.http__path.ashx
In addition, I change the obsolete command "matchclass" to new "class match" that offers better functionality and performance.
https://devcentral.f5.com/wiki/irules.class.ashx
So, my iRule woulld be :
when ACCESS_ACL_ALLOWED { set my_path_SAP [string tolower [HTTP::path]] } when HTTP_RESPONSE { if { [class match $my_path_SAP equals dg_my_path_SAP] } { REWRITE::disable } else { REWRITE::enable } }
So, are you sure that slow performance is about javascript? I have had good experiences in increasing SAP performance, just by enabling HTTP2/SPDY in the past.
Regards.
Recent Discussions
Related Content
* 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