0

I have set up the cloud cdn with using storage bucket as a backend.

I have expected to speed up the load by using cdn.

However, it seems cdn makes it even slower significantly.

https://cdn.gollala.org/koxp5r5u.png

https://storage.googleapis.com/gollala-product-images/koxp5r5u.png

Those are the same picture and cdn is pointing at the picture below.

However, it results the top one takes 270ms and bottom one takes 90ms.

When I used AWS CloudFront with the same picture it took 40 ms.

https://cdn.clayful.io/stores/JS2TEF7KYHK3.JHWZNVH6PYF2/images/X7HXD3QREH26/v1/koxp5r5u.jpg?width=300&height=400

I have a feeling that there is something wrong with the caching because the initial time does not differ as the other url does.

However, the console says cache hit is 100%. (and originally it shows N/A and if I query, then 100%)

I did everything in a "recommended" way and also enabled cdn as instructed.

Any idea? or is it an ordinary behavior?

HumbleCoder
  • 576
  • 1
  • 5
  • 19
  • How did you measure the time ? Was it the download time or the ping ? In my case download times were between 0.003-007s and ping 1,5ms for both (CDN and direct access). Add more details and I can try to help you. – Wojtek_B May 24 '21 at 14:16
  • I tested on my side (in europe, France). The first request takes 500ms for both endpoint. But I have to admit that it takes 3 or 4 hits on CDN endpoint , only 1 more for Cloud Storage, to have the same "in cache" performances (50ms). I guess there are several CDN cache servers and I didn't hit the same for all my requests. – guillaume blaquiere May 24 '21 at 18:57
  • @Wojtek_B Thank you for the comment Wojtek. I just declared const t1 = Number(new Date()) right before the HTTP call and did Number(new Date()) - t1. So it is a total time spent for the request. – HumbleCoder Jun 08 '21 at 05:53

0 Answers0