httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 60619] New: Negotiate precompressed files
Date Fri, 20 Jan 2017 21:08:09 GMT

            Bug ID: 60619
           Summary: Negotiate precompressed files
           Product: Apache httpd-2
           Version: 2.4.25
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: mod_negotiation
  Target Milestone: ---

There should be a way to configure the server so that if files “foo” and
“foo.gz” exist, then “foo.gz” gets served if “Accept-Encoding: gzip” is
specified in the request, and otherwise foo gets served. All of this with
proper negotiation, “Varies” header, handling of “;q=0”, and so on. is a
workaround, but doing content negotiation using mod_rewrite is hardly a proper

The key point here is the fact that the MultiViews option only has an effect if
the named file does not exist as such.

One solution might be a way to enforce MultiViews even if the file exists. Such
a setting could be either for specific files, or for all files. Or perhaps
depending on some environment variable.

If you can't agree to this, then another (less comfortable) solution would be
implementing special handling of the identity encoding. That way, users could
store files “” and “foo.gz”, could “AddEncoding identity .id”, the
absence of “foo” itself would trigger MultiViews, and the negotiation code
would know to fall back to the “identity” version if it couldn't find a better
fit. Having to rename all files would be annoying, but it's still better than
the mod_rewrite hack, I think.

I realize that you might consider type-map files the best (i.e. most
performant) solution. But I think generating the appropriate type maps is far
more work than renaming a bunch of files, so I hope for a simpler alternative.

There are a number of discussions of this issue on Stack Exchange:
So I would say this is a common enough problem. Many of the options suggest
adding “MultiViews” and “AddEncoding”, despite the fact that this doesn't work
as intended (and judging from the age of the relevant line it never did work).

You are receiving this mail because:
You are the assignee for the bug.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message