How to apply CORS preflight cache to an entire domain

前端 未结 3 1248
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 20:33

I am building a REST application that makes use of CORS. Every REST call is different and I am finding that there is significant overhead in getting the preflight OPTIONS ca

3条回答
  •  执念已碎
    2020-11-29 20:36

    Try using xDomain

    It was pretty simple for me to setup if using angular or jQuery. On your app server, add a proxy.html as stated in the help on the below link. Add some tags referring to the js files on your "client" and viola, no more pre-flights. This wraps in an iframe to avoid need for cors check.

    https://github.com/jpillora/xdomain

提交回复
热议问题