首页 > 编程知识 正文

vue保存视频到一半不动了,vue的缓存怎么解决

时间:2023-05-03 10:53:33 阅读:54444 作者:86

1 .页面已更新

headmetacharset=' utf-8 '/meta http-equiv=' pragma ' content=' no-cache ' /浏览器从本地磁盘缓存中获取页面内容meta http 禁止访问的请求和响应是meta http-equiv=' expires ' content='0' /如果指定的页面存储在缓存中多久,页面就会过期,content='0'

构建vue build时生成的时间戳将添加在JS和CSS之后。 这样,访问新资源时不会通过浏览器缓存。

let Timestamp=new Date ().getTime ); output : { filename : ` js/[ name ].$ { timestamp }.js `,chunk filename 3360 ` js/[ name ].$ { timestamp }.}

vue的所有资源都将更改并重命名为打包的名称,因此请使用强缓存,将它们添加到css、js、png、ttf、jpg等

location~*. (CSS|js|png|jpg|gif|gz|SVG|ogg|webm|XML ) $ { access _ ll } html文件不会重命名,因此使用协商缓存。 如果html文件发生更改,它将立即更新。 max-age=no-cache将进入协商缓存,文件更改将自动更新,如果没有更改,则返回304

位置~ *. (html ) $ { access_log off; add _ header cache -控制max-age=no-cache; }

#用户nobody; 工作器_ processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; 事件{ worker _ connections 1024; }http { include mime.types; efault _ type应用程序/octet-stream; # log _ format main ' $ remote _ addr-$ remote _ user [ $ time _ local ] ' $ request ' # ' $ status $ body _ $ $ sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; 服务器{ gzip on; gzip_min_length 1k; gzip_buffers 4 16k; # gzip _ http _版本1.0; gzip_comp_level 2; GIP _ types text/plain application/JavaScript application/x-JavaScript text/CSS application/xmltext/JavaScript aplice gzip_disable 'MSIE [1-6]. '; listen 8010 server_name localhost; location/wallet _ admin _ test { proxy _ pass http://suiyi.colum bu.world/wallet _ admin _ test; } error _ page 500502503504/50x.html; 根主机/磁盘; location/{ index index.html; try_files $uri $uri//index.html; (location () ().(html ) $ ) $ { access_log off; add _ header cache -控制max-age=no-cache; (location () ).(CSS|js|jpg|gif|gz|SVG|ogg|webm|XML ) $ { access _ } } }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。