How to Remove the ETag Field from the HTTP Response Header Using a Rewrite Policy

How to Remove the ETag Field from the HTTP Response Header Using a Rewrite Policy

book

Article ID: CTX130306

calendar_today

Updated On:

Description

This article contains information about removing the ETag field from the HTTP response header using a rewrite policy and action on a NetScaler appliance.

Background

The rewrite policy and action are created using the Graphical User Interface (GUI).
Note: Disabling a feature on a NetScaler appliance makes it impossible to prevent fields from being added to the HTTP header.

The following screenshot is a sample HTTP header:

image.png

 

Instructions

To remove the ETag field from the HTTP response header, complete the following steps:
Note: Ensure that the rewrite feature is enabled under Configuration > System > Settings > Modes and Features > Configure Basic Features
 
  1. Goto Configuration >  AppExpert > Rewrite > Actions in the GUI of the appliance.

  2. Click Add as shown in the following screenshot:

    • image.png

  3. Type the name for the action in the Name field, in the Create Rewrite Action dialog box.

  4. Select DELETE_ALL from the Type list.

  5. Type the expression HTTP.RES.FULL_HEADER in the Expression to choose the target text reference to be deleted field.
    Note: If you start typing the expression with HTTP, you can select the options that appear to complete the expression

  6. Select text in the Search Rewrite Action dialog box.

  7. Type ETag: in the Pattern section, as shown in the following screenshot:

    • image.png

  8. Click Create

  9. Goto Configuration >  AppExpert > Rewrite > Policies in the Navigation Pane.

    • image.png

  10. Click Add in the Rewrite Policies window.

  11. Type the policy name in the Name field.

  12. Choose the action that you created in Step 7 from the Action list.

  13. Click Add in the Expression section.

  14. Select the expression HTTP.RES.FULL_HEADER.CONTAINS("Etag:") in the Expression section, as shown in the following screenshot. Click OK.
    Note: ETag must be typed in the String field 

    • image.png

  15. Click Create.

  16. Click Close.

  17. Goto Configuration >  Load Balancing > Virtual Server

  18. Edit the Virtual Servers node to which you must bind the rewrite policy.

  19. Select the Policies on the Right side

  20. Click on + sign in the Policies

  21. Select Rewrite in the Choose Policy

  22. Select Response in the Choose Type and click Continue

    • image.png

  23. Select > arrow on Policy Binding

  24. Select the Rewrite Policy that is been created on Step 14 and click Bind

    • image.png

  25. Click Done in the LB Vserver
  26. Now Test the Header

Issue/Introduction

This article contains information about how to remove the ETag field from the HTTP response header using a rewrite policy and action on a NetScaler appliance.