仮想ホストの LocationMatch が機能しない

仮想ホストの LocationMatch が機能しない

特定の URL のキャッシュを無効にする必要があります。

私は .htaccess ファイルでこれらのディレクティブを使い始めましたが、うまく機能しています:

<IfModule mod_headers.c>
    Header unset ETag
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</IfModule>

これらのディレクティブは、Web サイトのどの URL でも機能します。
これらのディレクティブを特定の URL に対してのみ機能させる必要があるため、次のディレクティブを使用して、それらを仮想ホスト ファイルに移動しましたLocationMatch

<VirtualHost *:80>
        DocumentRoot ...
        ServerName ...

        <Directory ...>
                Options Indexes FollowSymLinks
                Order allow,deny
                Allow from all
                AllowOverride All
        </Directory>

        <LocationMatch "/compile">
            Header unset ETag
            Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
            Header set Pragma "no-cache"
            Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
    </LocationMatch>
</VirtualHost>

このコードはもう機能しません。

関連情報