You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2017/01/20 21:08:09 UTC

[Bug 60619] New: Negotiate precompressed files

https://bz.apache.org/bugzilla/show_bug.cgi?id=60619

            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
          Assignee: bugs@httpd.apache.org
          Reporter: Martin.vGagern@gmx.net
  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.

http://httpd.apache.org/docs/2.4/mod/mod_deflate.html#precompressed is a
workaround, but doing content negotiation using mod_rewrite is hardly a proper
solution.

The key point here is the fact that the MultiViews option only has an effect if
the named file does not exist as such.
https://github.com/apache/httpd/blob/fbc5e20ead005fd3a2bec05924f9e90dfd195406/modules/mappers/mod_negotiation.c#L3081-L3082

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 “foo.id” 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:
http://stackoverflow.com/q/75482/1468366
http://stackoverflow.com/q/9076752/1468366
http://stackoverflow.com/q/16883241/1468366
http://serverfault.com/q/131452/129921
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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60619] Negotiate precompressed files

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60619

Kevin Locke <ke...@kevinlocke.name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kevin@kevinlocke.name

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60619] Negotiate precompressed files

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60619

--- Comment #1 from Eric Covener <co...@gmail.com> ---
> 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.

FWIW I think this would be reasonable

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60619] Negotiate precompressed files

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60619

Szőgyényi Gábor <sz...@freemail.hu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |szg0000@freemail.hu

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org