Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment out CDN in data fetching guide #7404

Merged
merged 5 commits into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions docs/content/guides/6.best-practices/2.data-fetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ The rule of thumb is: _always use server-side fetching except for_:

Alokai architecture introduces the Middleware in between the front-end application and the APIs. This adds two additional possible routes to our diagram, but most of the traffic should go through the middleware, because:

- it is cached on the CDN
<!-- Uncomment below when CDN caching is availavble -->
<!-- - it is cached on the CDN -->
- it keeps your architecture simple
- you can easily monitor middleware traffic in the console
- enables [data federation](/middleware/guides/federation)
Expand All @@ -58,13 +59,17 @@ Fortunately, we can reject the route between the server and the API, because:
The direct route between the browser and API should be avoided, because it:

- tightly couples storefront with the API,
- reduces performance by bypasses CDN cache.
<!-- Uncomment below when CDN caching is availavble -->
<!-- - reduces performance by bypassing CDN cache. -->

Use direct direct browser to API calls only when communicating via middleware is not possible or requires unnecessary effort. Sample scenarios when it might be valid to communicate directly between client and API:

- the communication requires extremely low latency - e.g. voice or video stream
- communication with API is done via some SDK that requires direct client (browser) interaction - e.g. analytics or authentication services


<!-- Uncomment below when CDN caching is availavble -->
<!-- ## CDN Caching
## CDN Caching
To further improve your application performance we encourage you to enable the CDN. The CDN is capable of caching responses from the server and the middleware to the browser.
Expand All @@ -73,7 +78,7 @@ To further improve your application performance we encourage you to enable the C
::info
[Read more about caching here.](/storefront/features/cdn/making-ssr-cacheable)
::
:: -->

## Examples

Expand Down
Loading