Skip to content

Commit

Permalink
fix: revert etag implementation (frappe#28358)
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao authored Nov 3, 2024
1 parent 6574896 commit 7e0f281
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions frappe/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import re

from werkzeug.exceptions import HTTPException, NotFound
from werkzeug.http import generate_etag, is_resource_modified, quote_etag
from werkzeug.middleware.profiler import ProfilerMiddleware
from werkzeug.middleware.proxy_fix import ProxyFix
from werkzeug.middleware.shared_data import SharedDataMiddleware
Expand Down Expand Up @@ -154,11 +153,6 @@ def application(request: Request):
frappe.logger().error("Failed to run after request hook", exc_info=True)

log_request(request, response)
# return 304 if unmodified
if not response.direct_passthrough:
etag = generate_etag(response.data)
if not is_resource_modified(request.environ, etag):
return Response(status=304, headers={"ETag": quote_etag(etag)})
process_response(response)

return response
Expand Down Expand Up @@ -254,8 +248,6 @@ def process_response(response):
{
# default: 5m (proxy), 5m (client), 3h (allow stale resources for this long if upstream is down)
"Cache-Control": "public,s-maxage=300,max-age=300,stale-while-revalidate=10800",
# for revalidation of a stale resource
"ETag": quote_etag(generate_etag(response.data)),
}
)
else:
Expand Down

0 comments on commit 7e0f281

Please sign in to comment.