I am looking through some legacy code and I see this:
In the 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
In a controller:
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
and I think the CDN is Akamai. On a high level, what is going on here?