Skip to content

Improve cart insight performance#2

Open
runelaenen wants to merge 2 commits into
dotmailer:developfrom
runelaenen:feature/cart-insight-performance
Open

Improve cart insight performance#2
runelaenen wants to merge 2 commits into
dotmailer:developfrom
runelaenen:feature/cart-insight-performance

Conversation

@runelaenen
Copy link
Copy Markdown

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
Copy Markdown
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