• Resolved rajeshsingh520

    (@rajeshsingh520)


    I have W3 Total cache and Disk: Enhanced enabled

    I am using plugin https://wordpress.org/plugins/http2-push-content/ to http2 push

    This plugin is working fine it is Adding resources to the header, Problem is in the W3 total cache, as it adds the resources to disk enhanced cache

    Pushing work only ance after the cache is cleared, thereafter it stops working.

    I have checked cache/page_enhanced folder and it adds this resources in the .htaccess file to push, this .htaccess file is not adding this resource link in the header of the request.

    Why is this .htaccess header links not working?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,

    You are using another plugin to add http2 headers but they probably add them using PHP. Enhanced doesn’t touch any PHP, so, therefore, they’re not added to the response the second time the page is requested. They’re not in the .htaccess file because the other plugin doesn’t modify that file.
    You should use our http2 push settings instead.

    Thread Starter rajeshsingh520

    (@rajeshsingh520)

    But all the resources that are to be pushed (by this plugin) are getting added in the .htaccess file generated by w3 total cache in the cache/page_enhanced folder

    This is a .htaccess file that is present for the home page in the page_enhanced folder,
    you can see all this font file and other CSS files this was added to header by that plugin and w3 added them in .htaccess when generating cache.

    But due to some reason, this is not getting used when files are served

    <IfModule mod_headers.c>
        Header unset Link
        Header add Link '</wp-content/themes/truce/style.css>; rel=preload; as=style'
        Header add Link '</wp-content/themes/Divi/style.css>; rel=preload; as=style'
        Header add Link '</wp-includes/js/jquery/jquery.js>; rel=preload; as=script'
        Header add Link '</wp-content/plugins/google-analytics-for-wordpress/assets/js/frontend.min.js>; rel=preload; as=script'
        Header add Link '</wp-content/themes/truce/fonts/Lato-Bold.ttf>; rel=preload; as=font; crossorigin'
        Header add Link '</wp-content/themes/truce/fonts/Lato-Regular.ttf>; rel=preload; as=font; crossorigin'
        Header add Link '</wp-content/themes/truce/fonts/Lato-BoldItalic.ttf>; rel=preload; as=font; crossorigin'
        Header add Link '</wp-content/themes/Divi/core/admin/fonts/modules.ttf>; rel=preload; as=font; crossorigin'
        Header add Link '</wp-content/themes/truce/js/modernizr-webp.js>; rel=preload; as=script'
    </IfModule> 
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,
    It’s explained in the previous why the headers are not added to the response the second time the page is requested.
    And once again, You should use our http2 push settings instead.

    Thread Starter rajeshsingh520

    (@rajeshsingh520)

    Sorry if I am not getting you,

    But the htaccess file is created by the w3 total cache and it adds all the resources that are pushed by the plugin in it properly, But in spite of being in the .htaccess of the cache those are not added in the header

    is it because I am using disk enhanced, but even in Disk enhanced mode .htaccess file resources should be pushed

    <IfModule mod_headers.c>
        Header unset Link
        Header add Link '</wp-content/themes/truce/style.css>; rel=preload; as=style'
        Header add Link '</wp-content/themes/Divi/style.css>; rel=preload; as=style'
        Header add Link '</wp-includes/js/jquery/jquery.js>; rel=preload; as=script'
        Header add Link '</wp-content/plugins/google-analytics-for-wordpress/assets/js/frontend.min.js>; rel=preload; as=script'
        Header add Link '</wp-content/themes/truce/fonts/Lato-Bold.ttf>; rel=preload; as=font; crossorigin'
        Header add Link '</wp-content/themes/truce/fonts/Lato-Regular.ttf>; rel=preload; as=font; crossorigin'
        Header add Link '</wp-content/themes/truce/fonts/Lato-BoldItalic.ttf>; rel=preload; as=font; crossorigin'
        Header add Link '</wp-content/themes/Divi/core/admin/fonts/modules.ttf>; rel=preload; as=font; crossorigin'
        Header add Link '</wp-content/themes/truce/js/modernizr-webp.js>; rel=preload; as=script'
    </IfModule>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘HTTP2 Push only work for the first time’ is closed to new replies.