轨。防止CDN通过标头干扰http auth。到底是怎么回事?

时间:2016-03-11 21:30:19

标签: ruby-on-rails akamai

我正在查看一些遗留代码,我看到了:

在application_controller.rb

def set_cache_buster
   response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
   response.headers["Pragma"] = "no-cache"
   response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end

在控制器中:

respond_to do |format|
    format.json_v20150315 do
      set_cache_buster
      if stale?(last_modified: last_modified_for_models(recipes, current_api_user), etag: etag_for_models(recipes, current_api_user))
        render json: recipes, compact: true, each_serializer: Api::V20150315::RecipeSerializer, user: current_api_user
      end
end

我认为CDN是Akamai。从高层次来看,这里发生了什么?

0 个答案:

没有答案