即使参数更改也进行网页缓存 [英] Making a web page cache even if the parameters change

查看:103
本文介绍了即使参数更改也进行网页缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使参数发生变化,有没有办法让浏览器缓存网页?

Is there a way to get a browser to cache a web page even if the parameters change?

我有一个带参数的网络装配应用程序.如果参数更改,浏览器将强制下载.有什么方法可以设置标头,以使参数不是缓存中的一个因素?

I have a web assembly app that takes parameters. If the parameters change, the browser forces a download. Is there any way I can set headers so that the parameters aren't a factor in caching?

即如果可以的话

http://www.example.com?param=1234

http//:www.example.com?param=4321

...浏览器认为这是一个全新的网站,然后再次下载整个26mb的Web程序二进制文件.

...the browser thinks it's a whole new site and downloads the whole 26mb web assembly binary again.

我能做什么?

推荐答案

您可以使用缓存控制标头:

<?php

header("Cache-Control: public, max-age=604800, immutable");

这篇关于即使参数更改也进行网页缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆