Why are the Images being delivered 3 times.

0

I have problem with the images. in the Firefox developer tool I can see that the images are being delivered 3 times but only once cached. It makes big traffic for no reason. Once the image delivered from s3 bucket, once from execute-api, and once with the long name incl amz-algorithm in the link. Any idea why is it happening? I`ve attached the screenshot. Enter image description here

已提問 1 年前檢視次數 208 次
1 個回答
0

Hi.
Some of this is down to the "server" you are calling the asset from.
When you have a different host, even if the same file, generally browsers will not see it as a match and so not pull it from cache.
Cache in most browsers is handled as site (URL up to first /) and then the file name.
So, this is why when the host and file match, even with parameters after the file name, you see one is from cache.

This is actually good behavior as if my website had the same file name for an image you wouldn't want to show my image but the one from your site.

If you want to ensure that all images are cached you probably want to put a custom domain (same as website) on the API gateway.

profile picture
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南