With the Heroku add-on, you want to use our API for making configuration changes to your service. Here’s the link to our full API docs:
To get you started, here’s an example of using the API to get the current version number of your service:
curl -XGET -H 'Fastly-Key:<fastly_api_key>' https://api.fastly.com/service/<service_id>/version
If you’re unsure of your API key or service ID, use the
heroku config command, which will give you both of these values.
If you are gzipping on your origin, then we will serve the compressed content. However, if you would like us to compress the content, you’ll want to use the above Headers and Conditions to manually set up dynamic gzipping.
In Step 1, you create two conditions. The first one checks for content that can be gzipped based on the content type. In this example, it matching for the following:
Feel free to adjust this as needed for your service.
The second condition makes sure that you’re Varying on the gzippable content. Again, feel free to adjust the content type as needed.
After you’ve created the two conditions, you set up the two headers that will use the conditions you just created.
The first header, Force GZIP, forces the content that is matched by the condition “Gzippable” to be gzipped.
The second header, Vary Encoding, caches a different version for each of the content types set by the condition “Vary on gzip”. This forces the cache to respect different encodings so things don’t get confused.
If you have any other questions, let us know.