LoginSignup
219

More than 5 years have passed since last update.

posted at

updated at

VagrantでCSSの更新が反映されない場合の対処法

Vagrantで作成した開発環境でCSSの更新が反映されない現象が起こることがあります。

なぜこのような現象が発生するかというと、静的なファイルのようにリクエストの処理にデータのアクセスを必要としないときには、ファイルを読み込むことなくカーネルの sendfile を使って ファイルを送るようになっているからです。

以下のようにして sendfileを使わないようにします。

apacheの場合

httpd.conf
EnableSendfile off

nginxの場合

nginx.conf
sendfile off;

Webサーバーを再起動すればCSSの更新が適応されるようになると思います。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
219