ウェブサイト全体をやり直しており、ブラウザは同じURLにあるページのキャッシュindex.html
を使用しています。ブラウザが古いキャッシュ済みのindex.htmlを使用しないようにするにはどうすればよいですか?
これが問題ディレクトリの1つで.htaccess
ファイルの内容全体です:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /products/
# Remove 'index.html' from the URL for old links that include it.
RewriteCond %{THE_REQUEST} ^.*\index\.html?\ HTTP/
RewriteRule ^(.*)index\.html?$ "/products/$1" [R=301,L]
# Use index.php for all requests.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule^/products/index.php [L]
</IfModule>
# An atempt to tell the browser not to use a cached .html file.
ExpiresActive on
ExpiresByType text/html "access plus 0 seconds"
<FilesMatch "\.(html)$">
Header set Cache-Control "private, must-revalidate"
</FilesMatch>
私はここで、複数のものを試してみたが、何も作業していません。これは私がヘッダーに表示さのすべてである:
Request URL:http://www.example.com/products/
Request Method:GET
Status Code:200 OK (from cache)
何のリクエストヘッダやレスポンスヘッダはありません。
私はおそらく何かの最後に?28032012
のようなものを追加するためにRewriteRuleを試すことができると思っていますが、私はそれを試みる方法もわかりません。
あなたはindex.htmlページ自体を編集することができませんか? http://stackoverflow.com/questions/748193/html-php-page-being-cached-client-side-when-it-should-not-be –
私はできますが、可能。 – JDavis
mod_expiresがまったく動作しないようです。 LoadModule expires_module modules/mod_expires.soのコメントを外してもよろしいですか?その前に、ブラウザの一時ファイルを消去する必要があります。私はこれが役立つことを願っています – huangli