禁用网页缓存功能,需要在 head 标签内,添加相应的内容。在 WordPress 中可以这样做:
function hook_nocache() {
?>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<?php
}
add_action('wp_head', 'hook_nocache');
上面的例子,使用 wp_head 向页面头部添加了禁用缓存的内容。
-
WordPress6.5新功能-声明式插件依赖在 WordPress 6.5 中,插件依赖变简单了
-
WordPress 6.5 新功能 - 支持 AVIFWordPress 6.5 新功能 - 支持 AVIF
-
WordPress 6.5移除区块样板菜单项的方法WordPress 6.5新增的区块样板菜单项,可将不同区块组合成一个新的区块模板,方便重复使用。
-
WordPress做多语言企业网站近期常用小伙伴问追格小编,有没有计划做双语WordPress企业官网主题。
-
WordPress插件:LiteSpeed Cache 缓存插件LiteSpeed Cache是一款实用的WordPress缓存插件,专为使用LiteSpeed服务器的用户设计。它能显著提高网站加载速度,改善用户体验。
-
追格企业官网主题多语版惊艳上线:WordPress模块化DIY,重塑企业官网时代追格(zhuige.com)旗下WordPress企业官网主题(多语版)正式发布,多模块巧妙组合,打造非凡页面,简约或华丽,皆显震撼。官网新风尚,颠覆传统设计,C位出道,惊艳全场,重新定义WordPress企业官网。
暂无评论,抢个沙发...