Forum Discussion

JRahm's avatar
JRahm
Icon for Admin rankAdmin
Jan 22, 2026

AppWorld DC Booth Kiosk Generator

Welcome to AppWorld, community! You may or may not be with us in person, but you can watch this thread for iRules that are either generated or described by the Distributed Cloud AI Assistant.

1 Reply

  • AI-Generated iRule

    Prompt: Compress HTTP responses only for clients that send an Accept-Encoding: gzip header and for text content types

    Generated iRule (by F5 Distributed Cloud AI Assistant):

    when HTTP_REQUEST {
        # Check if the client sent an Accept-Encoding header with gzip
        if {[HTTP::header "Accept-Encoding"] contains "gzip"} {
            # Check if the content type is text
            if {[HTTP::header "Content-Type"] starts_with "text/"} {
                # Enable gzip compression for the response
                HTTP::header insert "Content-Encoding" "gzip"
                # Compress the response body
                set response_body [HTTP::response body]
                set compressed_body [gzip $response_body]
                HTTP::response body $compressed_body
            }
        }
    }