Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/377.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 是否可以使用CRA'缓存自定义(.html)文件;s默认的基于工作盒的缓存?像index.html一样被缓存_Javascript_Html_Reactjs_Create React App_Workbox - Fatal编程技术网

Javascript 是否可以使用CRA'缓存自定义(.html)文件;s默认的基于工作盒的缓存?像index.html一样被缓存

Javascript 是否可以使用CRA'缓存自定义(.html)文件;s默认的基于工作盒的缓存?像index.html一样被缓存,javascript,html,reactjs,create-react-app,workbox,Javascript,Html,Reactjs,Create React App,Workbox,我正在使用react脚本的默认基于workbox的缓存(即opt-in),我必须在主条目文件中调用以下命令,以缓存react应用程序所需的所有文件(index.html在此处预配置) serviceWorker.register(); 它工作得很好 但我有一个要求,在根级别(与index.html一起)缓存一个额外的html(我们称之为print.html)文件 由于我们的应用程序必须在没有互联网连接的情况下工作,因此无法缓存print.html会导致问题 我是否可以缓存print.html,

我正在使用react脚本的默认基于workbox的缓存(即opt-in),我必须在主条目文件中调用以下命令,以缓存react应用程序所需的所有文件(index.html在此处预配置)

serviceWorker.register();
它工作得很好

但我有一个要求,在根级别(与index.html一起)缓存一个额外的html(我们称之为print.html)文件

由于我们的应用程序必须在没有互联网连接的情况下工作,因此无法缓存print.html会导致问题

我是否可以缓存print.html,而不影响react脚本的默认缓存功能

如果这是不可能的,你能想出任何其他的方法来帮助我解决这个问题吗

谢谢

如果我不清楚,请评论。我会尽力澄清的