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

Improve cart insight performance #2

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

runelaenen
Copy link

Currently the Cart Insights will load the cart.json endpoint on every pageview. This means that an additional JSON request is sent for every pageload, which might slow down the experience on slower connections, and might slow down the server in high traffic scenarios.

Shopware by default already loads the 'Cart info widget' on every pageview. This widget also has the cart info available. By loading the Cart Insights inside this widget, it will push the correct state (cart insights & identification) to DotDigital, without the need of seperatly loading the cart.json endpoint.

It is possible that, due to custom theme changes, this might not work for some customer. For this I have added a configuration option so the user is able to choose between the two methods. The Cart Info-way will be better for performance, but the cart.json will work stabile on every system, even when the theme is overwriting the widget completely.

@runelaenen runelaenen force-pushed the feature/cart-insight-performance branch 2 times, most recently from 44b9abd to 0adc503 Compare July 29, 2024 08:25
@runelaenen runelaenen force-pushed the feature/cart-insight-performance branch from 0adc503 to f93cf34 Compare July 29, 2024 08:27
@sta1r
Copy link
Contributor

sta1r commented Jul 29, 2024

Hello again - awesome, we'll look soonest.

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.

2 participants