Safari ajax request Failed to load resource: The network connection was lost

前端 未结 2 724
故里飘歌
故里飘歌 2021-02-05 09:55

I\'m receiving a message \"Failed to load resource: The network connection was lost.\" in my application, which uses ajax requests to get content from

相关标签:
2条回答
  • 2021-02-05 10:34

    Had this trouble too with a form that ajax-posted and when that completed did a window.location.reload(true). Safari 13.0.3 would work the first time after a manual page refresh (seemed consistent) then would get "Failed to load resource: The network connection was lost." roughly 2 out of 3 clicks.

    Changed the client to:

    • use ajax-get instead of post (with a unique query param value each time)

    • on completion set a timer so that window.location.reload(true) was not done inside the ajax completion handler

    User reports that worked, not sure which one of those changes or both.

    Hope this helps someone...

    0 讨论(0)
  • 2021-02-05 10:37

    One of the reasons why it might happen is the way Safari handles some SSL certificates (mainly, LetsEncrypt). The solution is to put the line:

    ssl_session_cache shared:SSL:10m;

    to your nginx config.

    Source: https://community.letsencrypt.org/t/apple-safari-browsers-fail-to-connect/3731/3

    0 讨论(0)
提交回复
热议问题