Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

GraphQL caching with Fastly #6031

Merged
merged 10 commits into from
Nov 21, 2019
20 changes: 16 additions & 4 deletions guides/v2.2/cloud/cdn/configure-fastly.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,23 @@ For details on this TXT record, see the Fastly [DNS TXT record validation](https

## Upgrade the Fastly module {#upgrade}

Fastly updates the Fastly CDN for Magento 2 module to resolve issues, increase performance, and provide new features. You can find information about the latest release in the Fastly [Fastly release notes](https://github.com/fastly/fastly-magento2/releases) on GitHub.
Fastly updates the Fastly CDN for Magento 2 module to resolve issues, increase performance, and provide new features.
We recommend that you update the Fastly module in your Staging and Production environments to the [latest version](https://github.com/fastly/fastly-magento2/releases).

We recommend that you upgrade to the latest version of the Fastly module. See [Upgrade an extension]({{ page.baseurl }}/cloud/howtos/install-components.html):
After you update the module, you must upload the VCL code to apply the changes to the Fastly service configuration.

When you upgrade the Fastly module, you get a new version of the default Fastly VCL code that enables the integration with {{ site.data.var.ece }}. You must upload the new VCL code to apply the changes to the Fastly service configuration for your Staging and Production environments.
{:.procedure}
To check the version of Fastly CDN module for Magento 2:

1. Change to the root directory of your Cloud environment.

1. Use Composer to check the installed version.

```bash
composer show *fastly*
```

1. If the [latest release]((https://github.com/fastly/fastly-magento2/releases)is not installed, complete the steps to upgrade the Fastly module.

{:.procedure}
To upgrade the Fastly module:
Expand All @@ -303,4 +315,4 @@ To upgrade the Fastly module:
After you verify Fastly services on the Staging site, repeat the upgrade process in the Production environment.

{: .bs-callout-warning }
If you have uploaded a custom VCL snippet that has the same name as a default snippet, you may need to verify and update those snippets after you upgrade the Fastly module. We do not recommend replacing existing default snippets with custom snippets of the same name. For details on custom VCL, see [Custom Fastly VCL snippets]({{ page.baseurl }}/cloud/cdn/cloud-vcl-custom-snippets.html).
If have added a custom VCL snippet that has the same name as a default snippet, you may need to verify and update those snippets after you upgrade the Fastly module. We do not recommend replacing existing default snippets with custom snippets of the same name. For details on custom VCL, see [Custom Fastly VCL snippets]({{ page.baseurl }}/cloud/cdn/cloud-vcl-custom-snippets.html).
13 changes: 13 additions & 0 deletions guides/v2.3/graphql/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,20 @@ sub process_graphql_headers {

[Configure Varnish and your web server]({{page.baseurl}}/config-guide/varnish/config-varnish-configure.html) further describes how to configure the `default.vcl` file.

## Caching with Fastly

To cache GraphQL query results on {{ site.data.var.ece }}, the Cloud project must be running Fastly CDN module for Magento 2 version 1.2.118 or later.

{:procedure}
To enable GraphQL caching on Fastly:

1. Upgrade the Fastly CDN Module for Magento 2.x to version 1.2.118 or later.
1. Upload the updated VCL code to the Fastly servers.

[Set up Fastly]({{page.baseurl}}/cloud/cdn/configure-fastly.html) describes how to perform both of these tasks.

## X-Magento-Vary

The `X-Magento-Vary` cache cookie is not supported for GraphQL. The `Store` and `Content-Currency` headers, along with the content language (which is deduced) determine the context.

## Response headers
Expand Down