From 8d197726138e6c53483e9775bab104af71d63fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Meyer?= Date: Wed, 11 Dec 2024 11:47:39 +0100 Subject: [PATCH 1/6] docs: speculations rules API javascript plugin --- .../hosting/performance/performance-tweaks.md | 19 +++++++++++++++++++ .../storefront-reference/plugin-reference.md | 1 + 2 files changed, 20 insertions(+) diff --git a/guides/hosting/performance/performance-tweaks.md b/guides/hosting/performance/performance-tweaks.md index 93f038efb..0166b7443 100644 --- a/guides/hosting/performance/performance-tweaks.md +++ b/guides/hosting/performance/performance-tweaks.md @@ -286,3 +286,22 @@ Disabling the Product Stream Indexer has the following disadvantages: - When you change a product in a stream, the category page is not updated until the HTTP cache expires - You could also explicitly update the category page containing the stream to workaround if that is a problem - Also, the Line Item in the Stream Rule will always be evaluated to `false` + +To disable the Product Stream Indexer, you can set the following configuration: + +<<< @/docs/snippets/config/product_stream.yaml + +## Enable the Speculation Rules API + +::: info +This is available starting with Shopware 6.6.10.0 +::: + +You can enable that **experimental feature** via `Admin > Settings > System > Storefront`. The JavaScript Plugin will then +check if the [Browser supports the Speculation Rules API](https://caniuse.com/mdn-http_headers_speculation-rules) and if so, +it will add a script tag to the head of the document. For the [eagerness option](https://developer.chrome.com/docs/web-platform/prerender-pages#eagerness) +we are using `moderate` everywhere. That means a user must interact with a link to execute the pre-rendering. + +::: info +Keep in mind that pre-rendering is putting extra load on your server and also can affect your [analytics](https://developer.chrome.com/docs/web-platform/prerender-pages#impact-on-analytics). +::: \ No newline at end of file diff --git a/resources/references/storefront-reference/plugin-reference.md b/resources/references/storefront-reference/plugin-reference.md index c267106dc..224681ef5 100644 --- a/resources/references/storefront-reference/plugin-reference.md +++ b/resources/references/storefront-reference/plugin-reference.md @@ -63,6 +63,7 @@ This is a list of available javascript plugins and helpers that can be used and | `ScrollUpPlugin` | Displays a small button with an "arrow up" icon to scroll back to the top of the page. Used on all pages and only displayed when the user has scrolled down the page. | --- | | `SearchWidgetPlugin` | Renders a dropdown with search result suggestions underneath the main headers search input field, as soon as the user starts to type a search term. | --- | | `SetBrowserClassPlugin` | Adds CSS classes to the `` element depending on the current device, e.g. `is-ipad`. These classes can be used to add styling for a specific device category. | --- | +| `SpeculationRulesPlugin` | If this javascript plugin is activated via `Admin > Settings > System > Storefront`, it adds speculation rules for the main navigation, the product listing and the header logo. | --- | | `VariantSwitchPlugin` | This plugin submits the variant form with the correct data option. Used on the product detail page to switch between product variants. | --- | | `WishlistWidgetPlugin` | Shows how many items are currently on the wishlist. Used by the wishlist "heart" icon inside the main header. | --- | | `ZoomModalPlugin` | Opens a full-screen modal window with an image gallery. Can contain multiple images that the user can zoom into. Used on the product detail page. | --- | From fd68581d684af29e4d85859c5fd1b0f4af95acf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Meyer?= Date: Wed, 11 Dec 2024 11:51:26 +0100 Subject: [PATCH 2/6] docs: fix markdown lint --- guides/hosting/performance/performance-tweaks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/hosting/performance/performance-tweaks.md b/guides/hosting/performance/performance-tweaks.md index 0166b7443..1c815b197 100644 --- a/guides/hosting/performance/performance-tweaks.md +++ b/guides/hosting/performance/performance-tweaks.md @@ -298,10 +298,10 @@ This is available starting with Shopware 6.6.10.0 ::: You can enable that **experimental feature** via `Admin > Settings > System > Storefront`. The JavaScript Plugin will then -check if the [Browser supports the Speculation Rules API](https://caniuse.com/mdn-http_headers_speculation-rules) and if so, -it will add a script tag to the head of the document. For the [eagerness option](https://developer.chrome.com/docs/web-platform/prerender-pages#eagerness) +check if the [Browser supports the Speculation Rules API](https://caniuse.com/mdn-http_headers_speculation-rules) and if so, +it will add a script tag to the head of the document. For the [eagerness option](https://developer.chrome.com/docs/web-platform/prerender-pages#eagerness) we are using `moderate` everywhere. That means a user must interact with a link to execute the pre-rendering. ::: info Keep in mind that pre-rendering is putting extra load on your server and also can affect your [analytics](https://developer.chrome.com/docs/web-platform/prerender-pages#impact-on-analytics). -::: \ No newline at end of file +::: From 6baa27bed00c4ac36a1615368b5ca24b964b41d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Meyer?= Date: Wed, 11 Dec 2024 11:55:08 +0100 Subject: [PATCH 3/6] docs: fix spell checking --- guides/hosting/performance/performance-tweaks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/hosting/performance/performance-tweaks.md b/guides/hosting/performance/performance-tweaks.md index 1c815b197..5bbbecc1d 100644 --- a/guides/hosting/performance/performance-tweaks.md +++ b/guides/hosting/performance/performance-tweaks.md @@ -303,5 +303,5 @@ it will add a script tag to the head of the document. For the [eagerness option] we are using `moderate` everywhere. That means a user must interact with a link to execute the pre-rendering. ::: info -Keep in mind that pre-rendering is putting extra load on your server and also can affect your [analytics](https://developer.chrome.com/docs/web-platform/prerender-pages#impact-on-analytics). +Keep in mind that pre-rendering is putting extra load on your server and also can affect your [Analytics](https://developer.chrome.com/docs/web-platform/prerender-pages#impact-on-analytics). ::: From 7677df8bb1ac7998a2681e4fb35d5be265456315 Mon Sep 17 00:00:00 2001 From: Micha Date: Thu, 12 Dec 2024 09:06:38 +0100 Subject: [PATCH 4/6] Add info on what the feature does --- guides/hosting/performance/performance-tweaks.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/guides/hosting/performance/performance-tweaks.md b/guides/hosting/performance/performance-tweaks.md index 5bbbecc1d..4cf4edcfe 100644 --- a/guides/hosting/performance/performance-tweaks.md +++ b/guides/hosting/performance/performance-tweaks.md @@ -297,6 +297,9 @@ To disable the Product Stream Indexer, you can set the following configuration: This is available starting with Shopware 6.6.10.0 ::: +The Speculation Rules API allows browsers to pre-render pages based on user interactions. +This can improve the perceived performance of a website by loading pages in the background before the user navigates to them. + You can enable that **experimental feature** via `Admin > Settings > System > Storefront`. The JavaScript Plugin will then check if the [Browser supports the Speculation Rules API](https://caniuse.com/mdn-http_headers_speculation-rules) and if so, it will add a script tag to the head of the document. For the [eagerness option](https://developer.chrome.com/docs/web-platform/prerender-pages#eagerness) From 67aa439a0ff167ac335aca70582e418f6fe6c807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Meyer?= Date: Thu, 12 Dec 2024 11:29:32 +0100 Subject: [PATCH 5/6] docs: improve text about speculation rules API feature --- guides/hosting/performance/performance-tweaks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/hosting/performance/performance-tweaks.md b/guides/hosting/performance/performance-tweaks.md index 4cf4edcfe..5a50a62e6 100644 --- a/guides/hosting/performance/performance-tweaks.md +++ b/guides/hosting/performance/performance-tweaks.md @@ -294,10 +294,10 @@ To disable the Product Stream Indexer, you can set the following configuration: ## Enable the Speculation Rules API ::: info -This is available starting with Shopware 6.6.10.0 +This feature is available starting with Shopware 6.6.10.0 ::: -The Speculation Rules API allows browsers to pre-render pages based on user interactions. +The Speculation Rules API allows browsers to pre-render pages based on user interactions or immediately, depending on the eagerness mode. This can improve the perceived performance of a website by loading pages in the background before the user navigates to them. You can enable that **experimental feature** via `Admin > Settings > System > Storefront`. The JavaScript Plugin will then @@ -306,5 +306,5 @@ it will add a script tag to the head of the document. For the [eagerness option] we are using `moderate` everywhere. That means a user must interact with a link to execute the pre-rendering. ::: info -Keep in mind that pre-rendering is putting extra load on your server and also can affect your [Analytics](https://developer.chrome.com/docs/web-platform/prerender-pages#impact-on-analytics). +Keep in mind that pre-rendering puts extra load on your server and also can affect your [Analytics](https://developer.chrome.com/docs/web-platform/prerender-pages#impact-on-analytics). ::: From 124471745d5a9f38d01dfb50cfce12457f7d610c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Meyer?= Date: Thu, 12 Dec 2024 11:35:06 +0100 Subject: [PATCH 6/6] docs: eagerness setting --- guides/hosting/performance/performance-tweaks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/hosting/performance/performance-tweaks.md b/guides/hosting/performance/performance-tweaks.md index 5a50a62e6..149b93020 100644 --- a/guides/hosting/performance/performance-tweaks.md +++ b/guides/hosting/performance/performance-tweaks.md @@ -297,13 +297,13 @@ To disable the Product Stream Indexer, you can set the following configuration: This feature is available starting with Shopware 6.6.10.0 ::: -The Speculation Rules API allows browsers to pre-render pages based on user interactions or immediately, depending on the eagerness mode. +The Speculation Rules API allows browsers to pre-render pages based on user interactions or immediately, depending on the eagerness setting. This can improve the perceived performance of a website by loading pages in the background before the user navigates to them. You can enable that **experimental feature** via `Admin > Settings > System > Storefront`. The JavaScript Plugin will then check if the [Browser supports the Speculation Rules API](https://caniuse.com/mdn-http_headers_speculation-rules) and if so, -it will add a script tag to the head of the document. For the [eagerness option](https://developer.chrome.com/docs/web-platform/prerender-pages#eagerness) -we are using `moderate` everywhere. That means a user must interact with a link to execute the pre-rendering. +it will add a script tag to the head of the document. For the [eagerness setting](https://developer.chrome.com/docs/web-platform/prerender-pages#eagerness) +we are using `moderate` everywhere. That means **a user must interact** with a link to execute the pre-rendering. ::: info Keep in mind that pre-rendering puts extra load on your server and also can affect your [Analytics](https://developer.chrome.com/docs/web-platform/prerender-pages#impact-on-analytics).