cors-飞行前请求未缓存
发布时间:2022-02-23 02:41:08 373
相关标签: # chrome# json
我实施了“支持”;选项“;在最新的铬98与CORS.
由于客户端发出了很多请求,我想将它们添加到缓存中,但无论我在响应头中添加什么,它都无法工作。这是我收到的请求的截图
飞行前请求:
OPTIONS /watchPoll HTTP/1.1
Host: localhost:8085
Connection: keep-alive
Accept: */*
Access-Control-Request-Method: POST
Access-Control-Request-Private-Network: true
Origin: https://xxx.azurewebsites.net
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate, br
Accept-Language: en,fr;q=0.9,fr-FR;q=0.8,en-GB;q=0.7,en-US;q=0.6
飞行前响应:
HTTP/1.1 204 No Content
Date: Fri, 11 Feb 2022 13:41:16 GMT
Connection: Keep-Alive
Access-Control-Allow-Origin: https://xxx.azurewebsites.net
Access-Control-Allow-Private-Network: true
Access-Control-Max-Age: 600
Access-Control-Allow-Methods: POST
Cache-Control: private, max-age=600
Access-Control-Allow-Credentials: true
Vary: Origin, Access-Control-Allow-Private-Network, Access-Control-Allow-Credentials, Access-Control-Allow-Methods, Access-Control-Max-Age, Access-Control-Allow-Origin
主要要求:
POST /watchPoll HTTP/1.1
Host: localhost:8085
Connection: keep-alive
Content-Length: 64
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="98", "Microsoft Edge";v="98"
Accept: application/json, text/plain, */*
Content-Type: text/plain
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43
sec-ch-ua-platform: "Windows"
Origin: https://xxx.azurewebsites.net
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate, br
Accept-Language: en,fr;q=0.9,fr-FR;q=0.8,en-GB;q=0.7,en-US;q=0.6
主要回应:
HTTP/1.1 200 OK
Date: Fri, 11 Feb 2022 13:41:18 GMT
Connection: Keep-Alive
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Content-Type: text/zinc; charset=utf-8
我知道这是个问题刷新但这不是我正在做的,而且我已经尝试过改变这些参数,但没有成功:
- 删除Vary方法
- 将最大年龄从86400岁降至600岁
- 将访问控制允许原点设置为*
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报