We've been making changes to how we organize and display our docs. Our work isn't done but we'd love your feedback.
Getting started
Basics
Domains & Origins
Performance

Configuration
Basics
Conditions
Dictionaries
Domains & Origins
Request settings
Cache settings
Headers
Responses
Performance
Custom VCL
Image optimization
Video

Security
Access Control Lists
Monitoring and testing
Securing communications
TLS
Web Application Firewall

Integrations
Logging endpoints
Non-Fastly services

Diagnostics
Streaming logs
Debugging techniques
Common errors

Account info
Account management
Billing
User access and control

Reference

    Making query strings agnostic

      Last updated August 01, 2018

    Under normal circumstances, Fastly would consider these URLs different objects that are cached separately:

    It is possible, however, to have them all ignore the query string and return the same cached file.

    1. Log in to the Fastly web interface and click the Configure link.
    2. From the service menu, select the appropriate service.
    3. Click the Configuration button and then select Clone active. The Domains page appears.
    4. Click the Content link. The Content page appears.
    5. Click the Create header button. The Create a header window appears.

      the Header window

    6. Fill out the Create a header fields as follows:
      • In the Name field, type a description for the header (e.g., New query string name).
      • From the Type menu, select Request, and from Action menu, select Set.
      • In the Destination field, type url.
      • In the Source field, type req.url.path.
      • From the Ignore if set menu, select No.
      • Set the Priority field to whatever priority you want.
    7. Click the Create button to create the new header. The new header you created appears on the Content page.
    8. Click the Activate button to deploy your configuration changes.

    The request will be sent to the origin as a URL without the query string.

    For more information about controlling caching, see our Cache Control Tutorial.

    Back to Top