perf: Use cached redirects (#31698)
This commit is contained in:
parent
91430efdbb
commit
ba84768ba8
1 changed files with 4 additions and 3 deletions
|
|
@ -127,9 +127,10 @@ def resolve_redirect(path, query_string=None):
|
|||
return
|
||||
|
||||
redirects = frappe.get_hooks("website_redirects")
|
||||
redirects += frappe.get_all(
|
||||
"Website Route Redirect", ["source", "target", "redirect_http_status"], order_by=None
|
||||
)
|
||||
redirects += [
|
||||
{"source": r.source, "target": r.target, "redirect_http_status": r.redirect_http_status}
|
||||
for r in (frappe.get_website_settings("route_redirects") or [])
|
||||
]
|
||||
|
||||
if not redirects:
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue