mallgroup / mpapi-client-php

MPAPI client is a PHP tool created to help Internet Mall, a. s. partners easily manage article catalog, deliveries, orders, etc. using Mall Marketplace API.
Apache License 2.0
6 stars 19 forks source link

Media URL caching #8

Closed Nxis closed 3 years ago

Nxis commented 6 years ago

Hi,

would you please be so kind and check if the image caching (as you mention @ https://marketplaceapiv2.docs.apiary.io/#reference/products/getputdelete-product/put-product - media object “Picture is updated only if URL is different - use some parameter in URL...”) is working correctly?

Every day when we do all-product sync (once a day), your server requests about 10k+ images from our server and many of them multiple times:

92.43.60.70 - - [18/Mar/2018:22:49:16 +0100] "GET /obrazky/polozky/e2a/e2a394a8097a59ef2cd2cc6f1e77b1c7.jpg?poradi=1 HTTP/1.1" 200 162192 "-" "-"
92.43.60.70 - - [18/Mar/2018:22:49:16 +0100] "GET /obrazky/polozky/e2a/e2a394a8097a59ef2cd2cc6f1e77b1c7.jpg?poradi=1 HTTP/1.0" 200 162192 "-" "-"
92.43.60.70 - - [18/Mar/2018:22:49:17 +0100] "GET /obrazky/polozky/e2a/e2a394a8097a59ef2cd2cc6f1e77b1c7.jpg?poradi=1 HTTP/1.0" 200 162192 "-" "-"
92.43.60.70 - - [18/Mar/2018:22:49:17 +0100] "GET /obrazky/polozky/6e8/6e8ff044da5564deb6572d8bc24a4e80.jpg?poradi=2 HTTP/1.0" 200 83215 "-" "-"
92.43.60.70 - - [18/Mar/2018:22:49:17 +0100] "GET /obrazky/polozky/6e8/6e8ff044da5564deb6572d8bc24a4e80.jpg?poradi=2 HTTP/1.0" 200 83215 "-" "-"
92.43.60.70 - - [18/Mar/2018:22:49:17 +0100] "GET /obrazky/polozky/f9f/f9f1165ddd2ba91a047be3e78e3ba092.jpg?poradi=3 HTTP/1.0" 200 62572 "-" "-"
92.43.60.70 - - [18/Mar/2018:22:49:17 +0100] "GET /obrazky/polozky/f9f/f9f1165ddd2ba91a047be3e78e3ba092.jpg?poradi=3 HTTP/1.0" 200 62572 "-" "-"
...

I'm pretty sure it'd be a big conisidence that all our product images would change at the same time and also every day.

The problem comes down to many errors of this kind:

Client error: `PUT https://mpapi.mallgroup.com/v1/products/1388?client_id=...` resulted in a `400 Bad Request` response:
{"result":{"code":400,"status":"ERROR","message":"Invalid media url, cannot be downloaded from 'https:\/\/admin.flomat.cz\/obrazky\/polozky\/9e5\/9e58d15b5dec0239943113e779ac7d83.jpg?poradi=1'"},"data":{"key":"product.media","data":{"index":0,"data":{"url":"https:\/\/admin.flomat.cz\/obrazky\/polozky\/9e5\/9e58d15b5dec0239943113e779ac7d83.jpg?poradi=1","main":true,"switch":null}}}}

If you check the URL, it works fine. I'm not sure on which side this error occurs, but i'm not able to find any related 400 errors in our access log nor error log.

Thank you.

danielrataj commented 3 years ago

Closing this issue due to further inactivity. Please reopen in case of need. Thank you.