Search code examples
apache.htaccessflowplayermod-deflate

videos not playing in Flowplayer after configuring mod deflate


I configured Apache/2.2.17 server on Windows 7 with mod deflate configured in .htaccess as

SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \
 \.(?:exe|t?gz|zip|bz2|sit|rar)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

But everything worked fine except videos were not playing in Flowplayer so I changed (added SWF in exclude from gzip compression ) in .htaccess to

SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \
 \.(?:exe|t?gz|zip|bz2|sit|rar|swf)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

Now the video plays in flowplayer in all browsers except IE.

I want correct configuration to work in IE also.


Solution

  • The following config worked.

    # force deflate for mangled headers 
    # developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
    <IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
    SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$   ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
     </IfModule>
    </IfModule>
    
    # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
    <IfModule filter_module>
     FilterDeclare   COMPRESS
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/html
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/css
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/plain
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/x-component
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/javascript
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/json
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xhtml+xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/rss+xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/atom+xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/vnd.ms-fontobject
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/svg+xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/x-font-ttf
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $font/opentype
     FilterChain     COMPRESS
     FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
    </IfModule>
    
     <IfModule !mod_filter.c>
     # Legacy versions of Apache
     AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
     AddOutputFilterByType DEFLATE application/javascript
     AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
      AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml    application/atom+xml
       AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
     </IfModule>
      </IfModule>