0

Max OS version: 10.14.3

Safari version: Version 12.0.3 (14606.4.5)

I am facing a Safari only problem.

I use jQuery to detach() then append() one picture tag, which causes Safari to request the same image twice. That is not expected. And there is no such problem in Chrome and Firefox.

I did a demo in Github for your better understanding. https://github.com/EdmondWang/picture-tag-on-safari/tree/master

And this is the network panel of demo, you can see the JPG request of "[email protected]" is sent each time I click the button "move to red" and "move to blue". enter image description here

This is snapshot of whole request&response: enter image description here This is log of local node express app: enter image description here

Why I am struggling this problem is because we found image get reloaded each time our user swipe the slick [email protected] in Safari. And I found that it is because there are detach()&append() logic during swipe action.(the slickAdd method below) So I tried to mock the logic to reproduce the problem. enter image description here Does anybody know how to avoid this duplicated HTTP request?

15

1 Answer 1

0

Thanks @Jensv, setting max-age of Cache-Control inside response of image request as any value greater than 0 resolves duplicated http image request in Safari.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.