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 :disappointed_face:

At which event flow APM, I must to insert the rewrite::disable ? Or disable the process of rewrite.

Thanks you in advance.

Best Regards,

Hello, According to docs, I think you are doing it on the correct event (HTTP_RESPONSE).

As 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.

In addition, I change the obsolete command “matchclass” to new “class match” that offers better functionality and performance.

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.