Heroku の無料の 5 GB スペースに配置した単純なブログ アプリケーションがあります。get リクエストと post リクエストを送信すると、応答時間が速くなり、応答が返ってきます。
put リクエストでも同じことが起こります (アプリケーションで指定されている標準の 302 リダイレクトは、ローカル サーバーで完全に機能します)。ただし、実際のページでは数分後 (~10 ~ 20 分) になるまで、新しい情報でページが更新されません。
更新Heroku Rails コンソールを調べたところ、そこで情報が更新されているようです。ブラウザ/キャッシュの問題である可能性があると思いますが、その理由はよくわかりません。
なぜこれが起こっているのかよくわかりません。これが記事コントローラーの更新コードです。
def update
@article = Article.find(params[:id])
respond_to do |format|
if @article.update_attributes(params[:article])
format.html { redirect_to(@article, :notice => 'Article was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @article.errors, :status => :unprocessable_entity }
end
end
end
リクエストに応じて、テール ログの PUT リクエスト部分を以下に示します。
2013-06-19T01:13:01.124408+00:00 app[web.1]: Started PUT "/articles/5-Literary-
Compositions-" for 99.232.11.181 at 2013-06-19 01:13:01 +0000
2013-06-19T01:13:01.445438+00:00 heroku[router]: at=info method=POST path=/articles/5-
Literary-Compositions- host=hidden-taiga-5779.herokuapp.com fwd="99.232.11.181" dyno=web.1
connect=2ms service=516ms status=302 bytes=138
2013-06-19T01:13:01.443470+00:00 app[web.1]: Processing by ArticlesController#update as HTML
2013-06-19T01:13:01.443470+00:00 app[web.1]: #post information was in here, large post
2013-06-19T01:13:01.443470+00:00 app[web.1]:
Redirected to http://hidden-taiga-5779.herokuapp.com/articles/5-Literary-Compositions-
2013-06-19T01:13:01.443470+00:00 app[web.1]: Completed 302 Found in 279ms (ActiveRecord: 71.2ms)