Hi All,
We are having some weird issues with a shop we put on a staging environment.
When i go to the Carts section in the backoffice, I see a load of carts, but when I look in the database we only have 2 carts.
Tried rebuilding indexes, tried reloading the caches, deleted the TEMP folder. Nothing worked.
Does anybody have any idea on what this could be?
Thanks!
Puck
Well… never mind.
Not sure what happened, but after 13 hours or so the Carts are normal in the backoffice..
Hi @ipsisPuckHolshuijsen
Are you able to get hold of one of the cart IDs and double check the database? Carts live in the same table as the orders but they are not finalized. If you can’t see the cart in the order tables then it can only be from an index…
Are you sure you are looking at the same database as the staging site and that the correct indexes have been rebuilt?
Justin
Actually, just checked a v17 site I have on Umbraco Commerce and there’s no separate index for orders/carts so it can only be getting them from the database. I would double check which database you are looking at and confirm staging is using the same.
We think we have found the problem.
This piece of code is what we have in our program.cs:
`app.Use(async (context, next) => {
context.Response.OnStarting(() => {
context.Response.Headers["Cache-Control"] = "public, max-age=31536000";
return Task.CompletedTask;
});
await next();
});`
And it looks like that this is caching the carts, orders etc.
2 Likes
Yes, that was it.
We removed the code and all of a sudden everything started ‘working‘ normally. We see the cart changes, new orders etc.