• Resolved nits1404

    (@nits1404)


    HI,
    I have enable QUIC cdn and everything is working as expected. All files are being served from cache expect from the fonts like .woff. I saw in the response there is no cache control header in that too. I also tried adding this in the .htaccess file like this:
    <filesMatch “.(ttf|otf|woff|woff2)$”>
    Header set Cache-Control “max-age=604800, public”
    </filesMatch>

    Then rebooted the light speed server , purge every cache both on my server and on cdn. Still it is fetched from my site and there is no cache control header too.
    Thanks
    Report Number: VLXJGUIE

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    please go to QC dashboard -> domain -> CDN -> make sure you have toggled cache static ?

    or try turn it off and back on again

    Best regards,

    Thread Starter nits1404

    (@nits1404)

    Hi, static cache is on there. I can see files like css/js also serves from cdn but not woff file. And no cache control header on the font request.
    Thanks

    • This reply was modified 3 years, 11 months ago by nits1404.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Yes, checked up with devs

    the reason for that is your font miss cache-control or expire header

    please add it to them first , you may need to contact your hosting proder is

    <filesMatch “.(ttf|otf|woff|woff2)$”>
    Header set Cache-Control “max-age=604800, public”
    </filesMatch>
    

    didn’t work for you

    Best regards

    Thread Starter nits1404

    (@nits1404)

    HI,
    I am sorry i did not get what you are saying. Can you explain a bit??
    I am using self hosting with cyberpanel installed, what does hosting provider has to do with it??
    Also I have already added the below lines before but it does not seem to work:

    <filesMatch “.(ttf|otf|woff|woff2)$”>
    Header set Cache-Control “max-age=604800, public”
    </filesMatch>

    Is the location of this code is wrong?? I have placed it in the last just before the end wordpress comment and outside of <IfModule>

    Thanks

    • This reply was modified 3 years, 11 months ago by nits1404.
    • This reply was modified 3 years, 11 months ago by nits1404.
    Thread Starter nits1404

    (@nits1404)

    This is my .htaccess file

    # BEGIN LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    <IfModule LiteSpeed>
    RewriteEngine on
    CacheLookup on
    RewriteRule .* - [E=Cache-Control:no-autoflush]
    RewriteRule \.object-cache\.ini - [F,L]
    
    ### marker CACHE RESOURCE start ###
    RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
    ### marker CACHE RESOURCE end ###
    
    ### marker FAVICON start ###
    RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
    ### marker FAVICON end ###
    
    ### marker WEBP start ###
    RewriteCond %{HTTP_ACCEPT} "image/webp" [or]
    RewriteCond %{HTTP_USER_AGENT} "Page Speed"
    RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
    RewriteCond %{HTTP_USER_AGENT} iPhone.*Version/(\d{2}).*Safari
    RewriteCond %1 >13
    RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
    ### marker WEBP end ###
    
    ### marker DROPQS start ###
    CacheKeyModify -qs:fbclid
    CacheKeyModify -qs:gclid
    CacheKeyModify -qs:utm*
    CacheKeyModify -qs:_ga
    ### marker DROPQS end ###
    
    </IfModule>
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END LSCACHE
    # BEGIN NON_LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END NON_LSCACHE
    
    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    <filesMatch ".(ttf|otf|woff|woff2)$">
    Header set Cache-Control "max-age=604800, public"
    </filesMatch>
    
    # END WordPress
    Plugin Support qtwrk

    (@qtwrk)

    
    <filesMatch ".(ttf|otf|woff|woff2)$">
    Header set Cache-Control "max-age=604800, public"
    </filesMatch>
    

    it’s FilesMatch , not filesMatch

    https://httpd.apache.org/docs/2.4/mod/core.html#filesmatch

    it won’t work if you break the capitalization of letter

    • This reply was modified 3 years, 11 months ago by qtwrk.
    Thread Starter nits1404

    (@nits1404)

    HI, this is still not working. Can you tell me the place where i should add it?? As in the location within the .htaccess file. Maybe thats the problem?

    Plugin Support qtwrk

    (@qtwrk)

    anywhere should be okay

    but you can try at top of it first

    that’s the part I mentioned why you need to reach your provider for help first

    your server has kind of “special” set up

    Thread Starter nits1404

    (@nits1404)

    HI,
    i have talked to the provider team. They said this is not something that is blocked from their side and since i am using my own vps i have the full control of cache control header. So it seems provider is not the problem.

    • This reply was modified 3 years, 11 months ago by nits1404.
    Thread Starter nits1404

    (@nits1404)

    Solution to work it out. Maybe this is something that can be passed to the developer. It seems it cannot be controlled by the plugin.
    Okay the only thing that worked for me is:
    1)go to lightspeed admin console
    2) Go to general settings
    3) Go to Expires Settings
    4) In Expires By Types set ‘application/font-woff=A604800’ or whatever content type for you wish to cache
    5) Restart the lightspeed server.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    well , not exactly , that just work around the problem , not fix why that directive is not working

    on default LiteSpeed server, that directive just works though

    Best regards,

    Thread Starter nits1404

    (@nits1404)

    Hi,
    I meant if this is the issue this should be passed on to the dev team not the solution though. I knw this is a workaround but even I am not sure why editing .htaccess did not work????.
    I would be okay to share my machine to the Devs if they want to see.
    Thanks

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    of course it’s good thing to share experience , and it is appreciated.

    what I want to say here is , what you did is a server-level configuration , which is impossible from PHP/plugin level to accomplish , as PHP does not have permission to edit server conf

    Best regards,

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘No caching of fonts taking place on quic cloud cdn’ is closed to new replies.