cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Magento API and Varnish

Problem with Magento API and Varnish

Hi all,
I have a problem with cart update by API.
I use Varnish with Phoenix.
Update cart from web frontend it ok, but if i try to update cart from API with this code, I get an old cached version of data.
Example: If in XYZ customer's cart I have 3 products and he's adding another from web in Android app mobile who use API cart is not updated.

 

The code who I use for read cart are this:

$quote = Mage::getModel('sales/quote')->loadByCustomer($customerId);

$cartItems = $quote->getAllVisibleItems();

 

I think who this problem derives from use of cookie, but i don't have idea how to do, obviously if I shut down varnish or if I refresh cache it's all right.

 

I work on Magento 1.9.0.1, Varnish 3.0.7 and Phoenix 4.2.3

 

Thanks!

 

 

1 REPLY

Re: Problem with Magento API and Varnish

Varnish has several issues and is difficult to configure. You might want to consider our Page Cache Extension which has similar performance without the config headache.

 

To get varnish to work you will need to change your vlc file so that it can ignore those requests.

View our great Magento Extensions