URGENT you MUST allow us to purge carrier service cache

Max_Hodges
Shopify Partner
15 0 6

My carrier service API crashed. We got it running again, but customers are still getting the error because you are CACHING the error! You must provide a way to purge cache! If the customer tries to checkout with the same items in their cart and same address they get the "service unavailable" message because you are caching the failure! 

Kevin_McPhillip
Shopify Staff
Shopify Staff
14 0 2

Hello Max. Thanks for reporting this issue.

We have done some investigation and identified an area where we are being overly aggressive with caching shipping rates in some error cases. We will roll out a change to mitigate this problem today. Any cached rate lookups will expire within a matter of hours and you should not encounter this problem going forward.

Shipping_Wiz
Excursionist
89 0 6

Kevin,

Can you confirm that this has been implemented and if so, how many minutes or hours will it take for a cached rate to expire?

SW

shippingwiz@gmail.com
0 Likes
Max_Hodges
Shopify Partner
15 0 6


Here's what happens: we have a custom shopify app for calculating shipping rates for Japan Post. This is a non-commercial, private app which we developed for our shop. We may release it commercially soon. Presently if this app has some downtime for any reason (i.e. server outage, planned maintenance, etc.) then (of course) for that period no rates will be returned to our shopify customers. The problem is that Shopify caches those empty API responses, so once the app is available again, customers will receive the cached, empty responses (that is, they receive no rates).

So let's say we have several customers who try to checkout while the app is down. Shopify will cache the unique combination of cart (contents) and customer address. If the app is down they will get an error (no shipping rates available), then when the app is online again, they will get the same error (because it's now cached) UNLESS they modify their cart of address. 

Since it's hard for us to actually reach out to customers and tell them "oh you just need to change one letter in your address, like adding a '.' after 'AVE' , then you'll get shipping rates' because we have limited ability to identify and reach out to them in real-time . . . so we just lose those sales, because of this caching problem.

Hope you can appreciate the problem and do something to fix it. Let me know if it's not clear what's happening and I'll create a video demo to walk you through it.
Cheers,
Max
 

0 Likes
Max_Hodges
Shopify Partner
15 0 6

when calling a carrier service app, the shop address is also passed. I thought I should be able to change my shop address in order to circumvent the caching (because in theory the caching should only cache the same API call. right?, but it didn't work. Can you explain why changing the shop address doesn't do the trick?
 

0 Likes
Shipping_Wiz
Excursionist
89 0 6

Hey Max,

I asked a senior developer that has used the aforementioned API for many Shopify sites. 

His suggestion:

  • Write a program to automatically remove and then re-initialize the 'private app webhook'.
  • Invoke this program whenever your app recovers from a downtime. 
  • This procedure will ensure that the Shopify cache gets purged.

Contact me if you need further clarification or assistance.

And Kevin, will be great if you can respond to my question above.

SW

shippingwiz@gmail.com
0 Likes
Kevin_McPhillip
Shopify Staff
Shopify Staff
14 0 2

We deployed a change the same day as I commented above which correct the problem of caching rate lookup errors. Thank you again for alerting us to this issue. The TTL on any rate lookups you had would all have expired by the the end of the day.

To clarify current behaviour: Any rate lookups that result in either an error or empty response are cached for under a minute, simply to debounce identical requests. Any rate lookups with identical request values  that result in a successful response are cached for a few hours.
 

Shipping_Wiz
Excursionist
89 0 6

Thanks, Kevin!

SW

shippingwiz@gmail.com
0 Likes
Kevin_McPhillip
Shopify Staff
Shopify Staff
14 0 2

Happy to help.

0 Likes
Aqeel
Tourist
3 0 0

hi Kevin,

sorry to invoke this thread again, but is there a way that we can reduce the cache or simply stop it at all?

Regards,

Aqeel

0 Likes