You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/setup/configuration/content-delivery-network.mdx
+52-19Lines changed: 52 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -76,10 +76,10 @@ Only the homepage is delivered by Edge Delivery Services. All Commerce functiona
76
76
:::note
77
77
A common pattern is to move all Edge Delivery Services code into a subfolder called `aem`, and then route any path starting with `aem` to Edge Delivery Services.
78
78
:::
79
-
79
+
80
80
For general information on setting up Fastly for Adobe Commerce and accessing the Adobe Commerce Admin, see [Fastly services overview](https://experienceleague.adobe.com/en/docs/commerce-cloud-service/user-guide/cdn/fastly).
81
81
82
-
## Backend configuration
82
+
## Backend configuration
83
83
84
84
The first step is to configure a backend for each origin/service that Fastly needs to route to, which includes the following:
85
85
@@ -95,7 +95,7 @@ The Fastly configuration instructions on this page are based on the [`fastly-mag
# Only apply redirection if the URL has no country-specific path
352
+
353
+
# Only apply redirection if the URL has no country-specific path
354
354
355
355
# This snippet performs a GeoIP-based redirection. It checks if the request is made to the
356
356
# "example.com" domain and if the URL path is either the root ("/") or empty. If these conditions are met, it
@@ -590,7 +590,7 @@ x-cache-hits: 0, 37, 1, 0
590
590
```
591
591
592
592
*`content-encoding`: Should be `gzip` or `br` for things like JS assets and HTML files, which should be encoded from origin.
593
-
*`surrogate-key`: Should not be `text`. If the value is `text`, make sure you have correctly configured the `fetch` VCL snippet to return `deliver` for Edge Delivery Servicespaths.
593
+
*`surrogate-key`: Should not be `text`. If the value is `text`, make sure you have correctly configured the `fetch` VCL snippet to return `deliver` for Edge Delivery Servicespaths.
594
594
595
595
The reason for this validation step is that the [default Commerce Fastly VCL](https://github.com/fastly/fastly-magento2/blob/fdd616cd0f945530e02e92e594ca00fd7990f557/etc/vcl_snippets/fetch.vcl#L113) sets this. This overwrites the Edge Delivery Services surrogate key, which is required for cache invalidation to work correctly when a page is re-published.
596
596
@@ -679,6 +679,39 @@ Ensure that the base URL change is propagated to Catalog Service. You can do thi
679
679
680
680

681
681
682
-
## Debugging
682
+
## Troubleshooting
683
+
684
+
<Asidetype="note"title="It's confusing - we get it">
685
+
Fastly VCL and CDN configuration can be a bit overwhelming at first. Here's a collection of troubleshooting steps that might help you if you have problems.
686
+
</Aside>
687
+
688
+
### Fastly API quick reference
689
+
690
+
With your Fastly API Token you can make requests against the Fastly API for information or data that may be otherwise inaccessible. You can find your API Token in your Commerce Admin view under **Stores** > **Settings** > **Configuration** > **Advanced** > **System** > **Full Page Cache** > **Fastly Configuration**.
691
+
692
+
Here's a quick reference of things you can do with your API Token. See [Fastly's API documentation](https://www.fastly.com/documentation/reference/api/) for more details.
Fastly maintains a "version" of your snippets remotely on their servers. These versions are never pulled "down" to your Commerce environment, but can be "pushed" from your environment to Fastly. Unintentional local changes can cause things to become out of sync.
708
+
709
+
For example, renaming a snippet actually creates a new snippet with the new name, and does not delete the old one. You should not rename snippets unless you must. See [this issue](https://github.com/fastly/fastly-magento2/issues/708) for more information.
710
+
711
+
Your environment stores custom VCL snippets in the `var/vcl_snippets_custom/` directory. If you delete that directory or its contents, you will not be able to view, edit, or modify the snippets, even though they remain active in Fastly."
712
+
713
+
To resolve this, you should use the Fastly API to "pull" all snippets and then place them back in that folder (with permission **775**). The following table details how to construct the file correctly:
683
714
684
-
The full VCL script can be viewed to see which VCL snippet is applied and in which order. In the Commerce Admin, go to **Tools** (sibling of the VCL Snippets dropdown), select "List all Versions" and click the eye icon of the latest version to view the full generated VCL.
0 commit comments