AddOutputFilterByType
तो यह वहाँ पदावनत चिह्नित किया गया था httpd-2.2
में गंभीर सीमाएं था: यह वही है (मैं रिवर्स प्रॉक्सी कर रहा हूँ और यूआरएल और लिंक को फिर से लिखने) मेरे लिए काम किया है। लेकिन httpd-2.4
में यह निर्देश filter_module
पर ले जाया गया, सही और अप्रत्याशित।
Apache 2.2 में आप के बजाय सक्षम होना चाहिए filter_module
और deflate_module
और उपयोग:
# Declare a "gzip" filter, it should run after all internal filters like PHP or SSI
FilterDeclare gzip CONTENT_SET
# "gzip" filter can change "Content-Length", can not be used with range requests
FilterProtocol gzip change=yes;byteranges=no
# Enable "gzip" filter if "Content-Type" contains "text/html", "text/css" etc.
FilterProvider gzip DEFLATE resp=Content-Type $text/html
FilterProvider gzip DEFLATE resp=Content-Type $text/css
FilterProvider gzip DEFLATE resp=Content-Type $text/javascript
FilterProvider gzip DEFLATE resp=Content-Type $application/javascript
FilterProvider gzip DEFLATE resp=Content-Type $application/x-javascript
# Add "gzip" filter to the chain of filters
FilterChain gzip
deflate_module
केवल ब्राउज़रों कि अनुरोध हेडर में gzip
एन्कोडिंग के लिए समर्थन की घोषणा करने के संकुचित सामग्री में काम करेगा।
यह मैं bigtime में मदद की। फ़िल्टरप्रोवाइडर पर बस एक सिर: https://github.com/h5bp/html5-boilerplate/issues/1012 – cgp
Centos filter_module डिफ़ॉल्ट रूप से सक्षम नहीं है। असम्बद्ध होने की आवश्यकता है। –
इसने ईटैग को यादृच्छिक रूप से gzipped प्रतिक्रियाओं से गायब कर दिया। – Timothy003