# Selective Pass-through

**URL:** <https://community.f5.com/t/selective-pass-through/5391>\
**Category:** Technical Forums\
**Tags:** irules, compression, devops, application-delivery\
**Created:** [August 4, 2015, 11:00am UTC](https://community.f5.com/t/selective-pass-through/5391 "2015-08-04T11:00:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CHofmann\_213970](https://avatars.discourse-cdn.com/v4/letter/c/ea5d25/32.png) [@CHofmann\_213970](https://community.f5.com/u/CHofmann_213970)\
**Post date:** [August 4, 2015, 11:00am UTC](https://community.f5.com/t/selective-pass-through/5391/1 "2015-08-04T11:00:55Z")

</div>

Hello,

I need to inject data into some webpages using an iRule. The backend-server sends HTTP data chunked and compressed (gzip). However, only some pages need to be injected into. Those can be identified by an HTTP-Header (and only this way). I also need all outgoing traffic to be chunked and compressed and with working keep-alive connections.

I got this working by setting

```tcl
Response Chunking

```

and

```tcl
Compression

```

to

```tcl
Selective

```

and perform the injection itself in an iRule using

```tcl
STREAM::expression

```

.

The problem however is that all data is being decompressed (and in turn rechunked) by the f5, as soon as the compression module is not set to

```tcl
Disabled

```

. This induces an unnecessarily high load on the f5, which I’d like to avoid.

What I want is to identify the header in the response from the backend-server, if found inject, rechunk and recompress; otherwise completely pass-through all HTTP data without processing anything.

Setting the compression module to

```tcl
Disabled

```

seems to be unfeasible, since I can’t perform an injection anymore.

Using

```tcl
COMPRESS::disable

```

disables compression, not the compression module, thus decompressing everything from the server and sending it uncompressed to the client.

After fiddling around a bit, it seems that compression can be disabled implicitly by disabling HTTP processing (

```tcl
HTTP::disable

```

). But this seems to be incompatible with keep-alive connections (because the next request on the same connection isn’t recognized).

And now I ran out of ideas and ask here: is there any way to archive a selective pass-through, depending on a header sent by the backend-server?

I am using BIG-IP 10.2.4 Build 577.0 Final. We are thinking about switching to 11 in the mid-term, but a solution for 10 would be nice.

Thanks, Christian
