告警svg遵循浏览器缓存机制 #64

Closed
opened 2025-01-10 14:28:38 +08:00 by liangyuanpeng · 3 comments

如果 type 为 URL 的 fileInfo 希望可以遵循浏览器缓存机制.

默认情况下浏览器和静态文件服务端会有一个协商缓存的机制,文件变更了才会拉取文件,否则会使用浏览器缓存,当前展示alert svg 的逻辑是否可以依赖该机制? 目前是每次都请求文件的.

image

image

如果 type 为 URL 的 fileInfo 希望可以遵循浏览器缓存机制. 默认情况下浏览器和静态文件服务端会有一个协商缓存的机制,文件变更了才会拉取文件,否则会使用浏览器缓存,当前展示alert svg 的逻辑是否可以依赖该机制? 目前是每次都请求文件的. ![image](/attachments/45559854-c2c6-478f-8088-7ce97f5e0624) ![image](/attachments/e16d552a-8184-475e-ad94-24dc51d0301b)
liangyuanpeng added the
kind/feature
label 2025-01-10 14:28:38 +08:00
Author
Owner

优先级在 告警svg图显示异常 之后

优先级在 [告警svg图显示异常](https://gitea.yunhorn.com/smartoilets-front/projects/issues/60) 之后
Author
Owner

访问这个文件是返回了200的, 但看展示alert svg时似乎显示了304.

$ curl -X GET -I https://smartoilets.net/s3/test2/fallalert/0080E115053ECCE8_l8_alert_db80af3c431408077d1736358d12b548.svg
HTTP/1.1 200 OK
Server: nginx/1.20.1
Date: Fri, 10 Jan 2025 07:01:21 GMT
Content-Type: text/xml
Content-Length: 5585
Connection: keep-alive
Accept-Ranges: bytes
ETag: "f8d0abedda3dc4d266b0b522e3438c23"
Last-Modified: Fri, 10 Jan 2025 04:52:28 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Origin
Vary: Accept-Encoding
X-Amz-Id-2: f6fa62217c3f60e86ea652b5acb1f2d2a40661ff651678d6f494598159223dcd
X-Amz-Request-Id: 181942B623A243B8
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
x-amz-version-id: d24bb74f-9b10-45be-a0ba-ca7d82273b52

image

访问这个文件是返回了200的, 但看展示alert svg时似乎显示了304. ```shell $ curl -X GET -I https://smartoilets.net/s3/test2/fallalert/0080E115053ECCE8_l8_alert_db80af3c431408077d1736358d12b548.svg HTTP/1.1 200 OK Server: nginx/1.20.1 Date: Fri, 10 Jan 2025 07:01:21 GMT Content-Type: text/xml Content-Length: 5585 Connection: keep-alive Accept-Ranges: bytes ETag: "f8d0abedda3dc4d266b0b522e3438c23" Last-Modified: Fri, 10 Jan 2025 04:52:28 GMT Strict-Transport-Security: max-age=31536000; includeSubDomains Vary: Origin Vary: Accept-Encoding X-Amz-Id-2: f6fa62217c3f60e86ea652b5acb1f2d2a40661ff651678d6f494598159223dcd X-Amz-Request-Id: 181942B623A243B8 X-Content-Type-Options: nosniff X-Xss-Protection: 1; mode=block x-amz-version-id: d24bb74f-9b10-45be-a0ba-ca7d82273b52 ``` ![image](/attachments/bb00928c-c3ed-414c-afb1-bf3f758ea296)
Author
Owner

再确认了一遍,应该是遵循缓存的,只是F12时没有显示,

image

再确认了一遍,应该是遵循缓存的,只是F12时没有显示, ![image](/attachments/ca336c3b-4918-4bba-a672-cc99c3ad8949)
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: smartoilets-front/projects#64
No description provided.