• Resolved danieledezi

    (@danieledezi)


    Hello there,
    I use Litespeed Cache to connect object cache via memcached and Cloudflare Pro to deliver fast my website
    Actually I cannot deliver webp via cloudflare polish (and other CDNs neither) because my vary header is returning: User-Agent,User-Agent

    The reason that Polish is not turning images into webp is that the origin web server sends a vary header with a value other than accept-encoding.

    Same if i deactivate memcached…

    Should i set something in my Litespeed Cache plugin?

    • This topic was modified 2 years, 6 months ago by danieledezi.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support qtwrk

    (@qtwrk)

    I don’t think LSCWP will create vary header ?

    Thread Starter danieledezi

    (@danieledezi)

    I am not accusing ?? just seeing a cache problem and not using other plugins i thought Litespeed Cache in some way created this problem (probably not?)

    I’ve understood that problem is in htaccess (don’t know who modified it because i am not a developer so i am just trying to understand) where i am reading this:

    <IfModule mod_deflate.c>
        SetOutputFilter DEFLATE
        <IfModule mod_setenvif.c>
            # Netscape 4.x has some problems...
            BrowserMatch ^Mozilla/4 gzip-only-text/html
    
            # Netscape 4.06-4.08 have some more problems
            BrowserMatch ^Mozilla/4\.0[678] no-gzip
    
            # MSIE masquerades as Netscape, but it is fine
            # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    
            # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
            # the above regex won't work. You can use the following
            # workaround to get the desired effect:
            BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    
            # Don't compress images
            SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
        </IfModule>
    
        <IfModule mod_headers.c>
            # Make sure proxies don't deliver the wrong content
            Header append Vary User-Agent env=!dont-vary
        </IfModule>
    </IfModule>

    Probably i should modify it right?
    Can you advice me how to do it?

    I want deliver webp and it looks like this prevent to do it…

    Plugin Support qtwrk

    (@qtwrk)

    this rule is not created by LSCWP

    the only thing in LSCWP that related is “webp replacement” option , but I don’t that will be case here since CF will be in front to interpret the requests

    but this rule does look like related to vary and webp , suggest backup and remove them to check.

    Hi @danieledezi
    this works for me to get Cloudflare Polish work.

    #set header for Cloudflare image compression
    <IfModule mod_headers.c>
    <FilesMatch “\.(jpg|jpeg|png|gif)$”>
    Header set Vary: Accept-Encoding
    </FilesMatch>
    </IfModule>
    #the end of set header for Cloudflare image compression

    Make sure that quotes are standard ones, here are converted to left-right side
    I hope that will help

    • This reply was modified 2 years, 6 months ago by Jaro.
    Thread Starter danieledezi

    (@danieledezi)

    Yes Jaro, finally working thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Litespeed + Cloudflare problem with webP’ is closed to new replies.