Vimに保存されたファイルはWebページでは更新されません。

Vimに保存されたファイルはWebページでは更新されません。

サーバーはHTMLファイルを更新しようとしていますが、更新しても更新されず、代わりに古いコピーが提供されます。 :w を押して Enter を押す一般的なプロセスを経たが (挿入モードではない! :P) まだ何もない。

また、ファイルを編集しようとするたびに、.swpファイルがすでに他のプロセスで使用されているというメッセージが表示されますが、bashシェルのみが開いています(PuTTYを介して接続されています)...

ハードリロードしてキャッシュを削除してみましたが、役に立ちませんでした。他のブラウザでも試してみましたが、役に立ちませんでした。

また、スワップファイルをすべて削除し、メモ帳に保存されているバージョンから正しいファイルを貼り付けてみましたが、ファイルはまだ更新されません。

どんなアイデアがありますか?

脚注:.htmlファイルを編集しようとしたときに受け取ったエラーメッセージは次のとおりです。

E325: ATTENTION
Found a swap file by the name ".index.html.swp"
          owned by: orderof3   dated: Mon Apr 25 04:48:09 2016
         file name: ~orderof3/public_html/Inviqa/TechPt1/index.html
          modified: no
         user name: orderof3   host name: e9.ehosts.com
        process ID: 66769
While opening file "index.html"
             dated: Mon Apr 25 11:32:56 2016
      NEWER than swap file!

(1) Another program may be editing the same file.  If this is the case,
    be careful not to end up with two different instances of the same
    file when making changes.  Quit, or continue with caution.
(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r index.html"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".index.html.swp"
    to avoid this message.

Swap file ".index.html.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:

ベストアンサー1

これが静的ファイルの場合、ブラウザが実際に新しいファイルを検索していない可能性があります。Shift[更新]をクリックすると、[更新]をクリックしてこれを確認できます(少なくともFirefoxでは)。

それでも機能しないと、Webサーバーは変更を認識しなかった可能性があります。その場合、通常はWebサーバーを再ロードするだけで十分です。たとえば、apache2の場合

service  apache2 reload

または

systemctl reload apache2.service

極端な場合は、Webサーバーを再起動する必要があるかもしれません。それにもかかわらず、ファイルを保存する:w際に問題が発生した場合に通知します。vivi

おすすめ記事