【发布时间】:2011-06-14 14:48:15
【问题描述】:
我正在尝试在客户端缓存一些文档,以便更快地在它们之间切换。
文档已加载到 iframe 中,所以如何在浏览器中本地缓存它是个问题。
我的方法是有一个变量,item,然后做
if (item.cache) {
$('.holder', someElem).html(item.cache);
return;
}
item.cache = $('<iframe....');
$('.holder', someElem).html(item.cache);
但是,当注入到持有者上时,此方法会不断重新加载 iframe src。
客户端 iframe 缓存有什么好的方法吗?
【问题讨论】:
-
如果你想要相反 - 不要缓存 iframe - 请参阅Refresh iFrame (Cache Issue)
标签: javascript jquery caching iframe client-side