Skip to content

Comments

Add Edge caching implementation#457

Open
kibo-andycoles wants to merge 1 commit intoMozu:developfrom
KiboPS:develop
Open

Add Edge caching implementation#457
kibo-andycoles wants to merge 1 commit intoMozu:developfrom
KiboPS:develop

Conversation

@kibo-andycoles
Copy link

@kibo-andycoles kibo-andycoles commented Apr 6, 2023

Adds ability to use Akamai Edge-Caching header
https://techdocs.akamai.com/property-mgr/docs/know-caching

This can significantly speed up the initial render of your pages.

  1. Ability to turn on and off Edge caching for Home Page, PLP, and PDP pages
  2. Ability to set max-age of the header
  3. Dynamic visibility of my account page in navigation

Please only use Edge Caching if it makes sense for your implementation. If all users see the same data on PDP/PLP/Home whether logged in or not, then they can use this implementation as-is.

If there is different pricing based on the user's store or price list, then you will need more changes to assign unique query parameters. For example, if https://example.com/c/10 had different store pricing, you would need to add a query parameter like https://example.com/c/10?storeCode=10 to make the URL unique. Edge Caching will consider URLs with different query parameters unique.

No cookies are cached by the implementation. Cookies will not be sent on the initial page load, and will be handled by the loading of _mzBlank.gif.

Monetate and Google Analytics are fully supported with this change and should need no change.

Before using, please check all custom hypr templates in your code that is using the user model and ensure that cached pages are not using any customer-specific rendered data.

It is also important to check the usage of pageContext.isMobile and pageContext.isDesktop in the theme. These are not used in the core theme but possibly could be used in custom implemented code. Note that detecting whether the page is mobile or desktop by using these variables is not recommended (as they are guessed from the User Agent and could be incorrect, these variables were added in the time before reactive CSS was common). Use CSS Media queries to implement reactive CSS so the HTML/CSS is invariant under caching.

If you are working on improving the performance of your theme, make sure to work though https://docs.kibocommerce.com/help/maximize-theme-performance and make the changes recommended in this article as well.

Make sure to coordinate with Kibo before using this on your production tenant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant