• Resolved Trung Hieu Bui

    (@kaiderella)


    Since version 1.0.15, LiteSpeed Cache conflicts with code remove query strings:

    function remove_cssjs_ver( $src ) {
     if( strpos( $src, '?ver=' ) )
     $src = remove_query_arg( 'ver', $src );
     return $src;
    }
    add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
    add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );

    File has removed query string will not be cached anymore.

    https://demo.wpcanban.com/…t/plugins/simple-social-icons/svgxuse.js (expiration not specified)
    https://demo.wpcanban.com/…s/js/flexslider/jquery.flexslider.min.js (expiration not specified)
    https://demo.wpcanban.com/…es/genesis/lib/js/menu/superfish.args.js (expiration not specified)
    https://demo.wpcanban.com/…/themes/genesis/lib/js/menu/superfish.js (expiration not specified)
    https://demo.wpcanban.com/…ontent/themes/paradise/js/back-to-top.js (expiration not specified)
    https://demo.wpcanban.com/…emes/paradise/js/responsive-menus.min.js (expiration not specified)
    https://demo.wpcanban.com/…radise/wp-includes/js/hoverIntent.min.js (expiration not specified)
    https://demo.wpcanban.com/…includes/js/jquery/jquery-migrate.min.js (expiration not specified)
    https://demo.wpcanban.com/…paradise/wp-includes/js/jquery/jquery.js (expiration not specified)

    How to fix this?

    Thanks so much!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author LiteSpeed Technologies

    (@litespeedtech)

    Hi @kaiderella

    Could you rephrase your question? I don’t quite understand what the issue is.

    One thing to note, our plugin does not cache static files (.js, .css) anyway.

    Thanks,
    Kevin

    Thread Starter Trung Hieu Bui

    (@kaiderella)

    Dear Kevin,

    When I remove query string, Google PageSpeed Insights will report JS files uncached:

    https://goo.gl/photos/Lcxy6pQSKFijMhwE8

    If I do not remove query string, the above error will not appear:

    https://goo.gl/photos/dTLKcmMBbVxJkBgi9

    This problem does not occur on previous versions. Do you understand?

    Thanks so much!

    Plugin Author LiteSpeed Technologies

    (@litespeedtech)

    The LiteSpeed Cache plugin does not apply any browser caching rules, so it might be an interference with another plugin.

    Could you go to your wp-admin, under LiteSpeed Cache -> Environment Report, could you copy and paste it here? It’ll provide us with information that could prove useful to determining why there was a change.

    Thanks,
    Kevin

    Thread Starter Trung Hieu Bui

    (@kaiderella)

    Dear Kevin,

    Here is my report:

    Server Variables
        SERVER_SOFTWARE = LiteSpeed
        DOCUMENT_ROOT = /home/wpcanban/public_html
        X-LSCACHE = 1
    
    LSCache Plugin Options
        version = 1.0.15
        enabled = 1
        radio_select = 1
        purge_upgrade = 1
        cache_commenters = 
        cache_login = 1
        cache_favicon = 1
        cache_resources = 1
        mobileview_enabled = 
        mobileview_rules = 
        login_cookie = 
        tag_prefix = 
        check_advancedcache = 1
        debug = 0
        admin_ips = 127.0.0.1
        test_ips = 
        public_ttl = 86400
        front_page_ttl = 3600
        feed_ttl = 0
        404_ttl = 3600
        purge_by_post = -.A.D.F.H.M.PGS.PGSRP.PT.T.Y
        excludes_uri = 
        excludes_cat = 
        excludes_tag = 
        nocache_cookies = 
        nocache_useragents = 
        403_ttl = 3600
        500_ttl = 3600
    
    Wordpress Specific Extras
        wordpress version = 4.7.4
        locale = vi
        active theme = Paradise
        active plugins = Array
    (
        [0] => vaultpress/vaultpress.php
        [1] => accelerated-mobile-pages/accelerated-moblie-pages.php
        [2] => advanced-database-cleaner/advanced-db-cleaner.php
        [3] => akismet/akismet.php
        [4] => allfacebook-instant-articles/afb_instant_articles.php
        [5] => amp/amp.php
        [6] => comment-approved/comment-approved.php
        [7] => easy-wp-smtp/easy-wp-smtp.php
        [8] => heartbeat-control/heartbeat-control.php
        [9] => jetpack/jetpack.php
        [10] => kk-star-ratings/index.php
        [11] => litespeed-cache/litespeed-cache.php
        [12] => nofollow-for-external-link/nofollow-external-link.php
        [13] => replyme/replyme.php
        [14] => shortpixel-image-optimiser/wp-shortpixel.php
        [15] => tablepress-responsive-tables/tablepress-responsive-tables.php
        [16] => tablepress/tablepress.php
        [17] => top-commentators-widget/top-commentators-widget.php
        [18] => wordpress-seo/wp-seo.php
        [19] => wp-memcached/wp-memcached.php
    )
    
    /home/wpcanban/public_html/.htaccess contents:
    <IfModule LiteSpeed>
    ###LSCACHE START PLUGIN - Do not edit the contents of this block!###
    RewriteEngine on
    CacheLookup Public on
    ###LSCACHE START RESOURCE###
    RewriteRule wp-content/.*/[^/]*(loader|fonts|\.css|\.js)\.php - [E=cache-control:max-age=3600]
    ###LSCACHE END RESOURCE###
    ###LSCACHE START FAVICON###
    RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
    ###LSCACHE END FAVICON###
    
    ###LSCACHE END PLUGIN - Do not edit the contents of this block!###
    </IfModule>
    
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteCond %{HTTP_ACCEPT} image/webp
    	RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
    	RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
    </IfModule>
    
    <IfModule mod_headers.c>
    	Header append Vary Accept env=REDIRECT_accept
    </IfModule>
    
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
    
    Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    AddType application/x-font-woff2 woff2
    AddType image/webp .webp

    Thanks

    Plugin Author LiteSpeed Technologies

    (@litespeedtech)

    I don’t see anything specifically that will set the browser cache. Could you DEACTIVATE LiteSpeed Cache and see if the browser cache works?

    If DEACTIVATING LiteSpeed Cache does not change anything, try adding the following rules to your .htaccess file:

    
    ExpiresByType text/css                  "access plus 1 year"
    ExpiresByType application/javascript    "access plus 1 year"
    
    Thread Starter Trung Hieu Bui

    (@kaiderella)

    It does not work, even when I add the code below to the .htaccess file:

    ExpiresByType text/css                  "access plus 1 year"
    ExpiresByType application/javascript    "access plus 1 year"
    Plugin Author LiteSpeed Technologies

    (@litespeedtech)

    What happens if you try to downgrade to 1.0.14.1?

    If it works, could you send an email to the email listed on the plugin description? Include a link to this thread so we have some context as to what the issue is.

    If it does not work, it is likely due to a change in another plugin, and we cannot assist with that.

    Thread Starter Trung Hieu Bui

    (@kaiderella)

    The issue is not resolved when I downgrade to version 1.0.14.1. It looks like the problem comes from another plugin. Thanks for your helping!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Conflict with remove query string functions’ is closed to new replies.