我的一个wordpress网站出现了一个奇怪的问题。问题是,当一个网页呈现一次时,编辑该页面之后将不会生效。因此,无论您刷新页面多少次(使用F5),它都会显示旧版本。但按ctrl+f5可以解决问题,并显示页面的当前版本。我不使用缓存插件。我已在中禁用浏览器缓存。htaccess使用以下代码。
我不知道还能做些什么来解决这个问题。非常感谢您的任何建议。
# DISABLE CACHING
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>
<FilesMatch "\\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|mp3|mp4|png|pdf|swf|txt)$">
<IfModule mod_expires.c>
ExpiresActive Off
</IfModule>
<IfModule mod_headers.c>
FileETag None
Header unset ETag
Header unset Pragma
Header unset Cache-Control
Header unset Last-Modified
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
</IfModule>
</FilesMatch>
编辑1:
Http响应头(F5)
Request URL: https://abobargh.ir/compare/
Request Method: GET
Status Code: 200 (from service worker)
Referrer Policy: strict-origin-when-cross-origin
content-encoding: br
content-type: text/html; charset=UTF-8
date: Fri, 16 Apr 2021 15:52:30 GMT
link: <https://abobargh.ir/wp-json/>; rel="https://api.w.org/", <https://abobargh.ir/wp-json/wp/v2/pages/18>; rel="alternate"; type="application/json", <https://abobargh.ir/?p=18>; rel=shortlink
vary: Accept-Encoding
Provisional headers are shown. Disable cache to see full headers.
sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"
sec-ch-ua-mobile: ?0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36
Http响应标头(Ctrl+F5)
Request URL: https://abobargh.ir/compare/
Request Method: GET
Status Code: 200
Remote Address: 89.39.208.172:443
Referrer Policy: strict-origin-when-cross-origin
cache-control: public, max-age=2592000
content-encoding: br
content-type: text/html; charset=UTF-8
date: Fri, 16 Apr 2021 18:34:35 GMT
expires: Sun, 16 May 2021 18:34:35 GMT
link: <https://abobargh.ir/wp-json/>; rel="https://api.w.org/"
link: <https://abobargh.ir/wp-json/wp/v2/pages/18>; rel="alternate"; type="application/json"
link: <https://abobargh.ir/?p=18>; rel=shortlink
vary: Accept-Encoding
:authority: abobargh.ir
:method: GET
:path: /compare/
:scheme: https
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
accept-encoding: gzip, deflate, br
accept-language: en-GB,en;q=0.9
cache-control: no-cache
cookie: irk-compare-list=18449%2C19458%2C41925
pragma: no-cache
sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"
sec-ch-ua-mobile: ?0
sec-fetch-dest: document
sec-fetch-mode: navigate
sec-fetch-site: none
sec-fetch-user: ?1
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36