#33700: APPEND_SLASH adds significant latency to all requests not ending in /
(even
if successful)
-------------------------------------+-------------------------------------
Reporter: Anders Kaseorg | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: HTTP handling | Version: 4.0
Severity: Normal | Resolution:
Keywords: CommonMiddleware | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Anders Kaseorg):
We have a mix of URLs with `/` (most user-facing HTML) and URLs without
`/` (REST API with compatibility considerations, access-controlled
uploaded files with given names, SAML `metadata.xml`, SCIM endpoints at
specified paths, static content in development). `RUNNING_INSIDE_TORNADO`
is not the right test; it was just an easy workaround for one part of the
problem. Of course we can fork `CommonMiddleware` in an arbitrary Zulip-
specific way, but we’d prefer to improve Django for everyone, and this
seems like a clear opportunity for that.
I don’t think it’s reasonable to assume that URLs without `/` are likely
incorrect. Many URLs are required to be without `/` for compatibility or
convention or other technical reasons. I’m typing this very comment at a
URL without `/`.
I’ve done some more investigation with the help of `git bisect`, and I
found that the logging problem #26293 that was targeted by
9390da7fb6e251eaa9a785692f987296cb14523f was subsequently addressed more
completely by 40b69607c751c4afa453edfd41d2ed155e58187e (#26504).
Therefore, we can simply revert 9390da7fb6e251eaa9a785692f987296cb14523f
to improve performance without regressing #26293. Everybody wins!
--
Ticket URL: <https://code.djangoproject.com/ticket/33700#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070180b9f3bf5e-02f977d8-b908-4c72-89de-a93399e0b67d-000000%40eu-central-1.amazonses.com.