Support » Plugin: Cloudflare » Server Push broken

  • Resolved Abigailm

    (@abigailm)


    All of the sudden Server Push stopped working on all of my sites — my error logs are quickly filling with thousands of lines like this.

    Cannot Server Push (header size over 3072 Bytes).

    It started happening at the same time that I upgrade to version 3.3.1, but rolling back to plugin version 3.3.0 does not resolve the error.

    I did nothing that I am aware of that would have changed the header size on my sites.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author thellimist

    (@furkan811)

    Hi @abigailm,

    In 3.3.0 we’ve added logging for HTTP Server Push. Previously on your server, Server Push was failing silently for some requests. We’ve only added logs to allow users be aware that some or all of their requests are not being Pushed because the header size is over 3072 Bytes. HTTP Server Push was not working on your site with 100% efficiency.

    My advice would be figuring out why your header sizes are so big and try to make them smaller before using Server Push. Otherwise I’d suggest you disabling HTTP/2 Server Push because you’re not benefiting from it.

    Let me know if you have questions.

    Thanks

    Thanks for this explanation, but I didn’t actually start seeing this error in the logs until the upgrade to version 3.3.1 of the plugin — so not sure why.

    I guess I will disable server push for now because it looks like various plugins or themes I use are adding inline styles to the header area.

    However, I think you should document this logging function better and provide an option to turn it on or off — or simply to enable it only for a short time for debugging purposes. I would not have noticed the errors if I had not already been monitoring error logs for another problem (unrelated to this plugin, probably connected to the most recent WP upgrade). The problem is that this generates thousands of lines of errors resulting in error logs that grow very rapidly, and log files that large can cause an array of other problems on a server or hosting account. And since it is a single line error, there is no value to having a log with thousands of entries– a simple option to enable the log briefly to “debug” server push would be more useful.

    (Or how about a feature that in the plugin that would test header size before enabling server push? And automatically disable it if it isn’t going to work).

    Question: Other than server push, is there anything that the Cloudflare plugin currently does that I can’t do using the Cloudflare site dashboard? I’m thinking that if I don’t use server push on some sites, I probably don’t need the plugin.

    Plugin Author thellimist

    (@furkan811)

    > I didn’t actually start seeing this error in the logs until the upgrade to version 3.3.1 of the plugin — so not sure why.

    The reason is we added the logging in v3.3.0. It’s expected that you didn’t see this before.

    > Question: Other than server push, is there anything that the Cloudflare plugin currently does that I can’t do using the Cloudflare site dashboard? I’m thinking that if I don’t use server push on some sites, I probably don’t need the plugin.

    Yes, please check https://wordpress.org/plugins/cloudflare/. A summarization of unique features would be

    – Automatic cache purge
    – Prevent a redirect loop for flexible SSL
    – Applying default settings

    • This reply was modified 4 months, 2 weeks ago by  thellimist.

    But if you added logging in v. 3.3.0 .. than why wouldn’t the error logs have started then, rather than with the more recent upgrade to 3.3.1? (Just curious — since it started on 4 separate sites only with the 3.3.1 upgrade, but I always upgrade plugins very promptly.)

    I hope you will consider the feasiblity of adding a header-check and automatic disabling of server push within the Cloudflare plugin for the future.

    Until then, can you give me a suggestion or pointer as to how to check header size manually? Is it only the response headers that are counted? or everything between the html <head> tags?

    Ok – I’ve realized now that the plugin was upgraded directly from 3.21 to 3.31 – so even though there is a 3.3.0 in the repository, it was never on any my sites. (From the changelog, it looks like you 3.3.1 was released the same day as 3.3.0)

    I still would like a way to check the response header size — there simply is no way for me to debug if I can’t see WHAT accounts for the large size. My guess is that because the Cloudflare system automatically pushes all linked stylesheets and scripts, that 3 kb limit is going to get quickly hit on many wordpress sites, especially premium themes or themes with a lot of plugins. I think the solution would be a more interactive setting, that would allow more user control of settings via the plugin dashboard.

    I’d note that I tested this plugin on one of my sites: https://wordpress.org/plugins/http2-server-push/ — and this does seem to enable httpd2 server push and works fine withe cloudflare. (I can see from chrome://net-internals that resources are being pushed on that site)

    However, testing with Google Page Speed Insights shows that page speed with the server push enabled is actually slightly worse than without it, so it may that the server push is not helpful on some sites in any case.

    I assume that changing the wp-config directive as follows is sufficient to disable the http2 push (?):

    define(‘CLOUDFLARE_HTTP2_SERVER_PUSH_ACTIVE’, false);

    Can Cannot Server Push (header size over 3072 Bytes). error cause any actual website errors or is it just a warning it’s not using push?

    Plugin Author thellimist

    (@furkan811)

    > Can Cannot Server Push (header size over 3072 Bytes). error cause any actual website errors or is it just a warning it’s not using push?

    It’s just a warning. It’d cause no errors except for filling the logs which may cause issues.

    > I assume that changing the wp-config directive as follows is sufficient to disable the http2 push (?):

    Yes

    > https://wordpress.org/plugins/http2-server-push/ — and this does seem to enable httpd2 server push and works fine withe cloudflare.

    Cloudflare plugin acts cautiously on adding new headers. I haven’t used that plugin. If your website has enough header size, in theory pushing the correct assets should speed the website in average by a significant amount.

    If your website has enough header size, in theory pushing the correct assets should speed the website in average by a significant amount.

    The problem is that neither Cloudflare nor the other plugin I mentioned allows for manual determination of which assets to push. So I think the slowdown comes when more is pushed than necessary.

    If the Cloudflare plugin had its own setup page for push, it could allow users to select & de-select assets, and this could also resolve the header size problem. The problem is simply that a lot of themes and plugins add script or stylesheets that are not needed for initial page rendering, and/or may support functions that are only used by a small percentage of users.

    Anyway — this now is just a feature request for the future.

    Plugin Author thellimist

    (@furkan811)

    Here is a similar feedback.

    We’ll keep your request in mind and if we’ve enough requests we may go for that path.

    Thanks for you suggestion.

    Plugin Author jwineman

    (@jwineman)

    @abigailm,

    The problem is that neither Cloudflare nor the other plugin I mentioned allows for manual determination of which assets to push.

    I might be wrong but I think this goes against how HTTP2 is intended to be used. The speed benefits of HTTP2 are because <all/em> the assets are loaded in parallel instead of sequentially. If you only load some of the assets over HTTP2 and some over HTTP you negate the full benefits of using HTTP2.

    We’re actively looking for better ways to detect the max header size available but its difficult since so much of it is environment specific, which is why we removed the feature from the GUI and into a flag.

    Thanks,
    John

    Hi there,

    I was looking at the code and noticed the comment that cloudflare has 8KB limit and fastcgi has a 4KB limit. If we are using mod_php and not fast-cgi, is it safe to change:

    if ($headerSize > 3072) {

    to:
    if ($headerSize > 7168) {
    ?

    Also what is the reason you test against 3KB instead of 4KB?

    Plugin Author thellimist

    (@furkan811)

    Hi @labcat,

    It is safe to increase up to 7KB if you know that the buffer size of your system is high enough. It’s also possible to increase the buffer size in fast-cgi. The issue is by default on some systems the buffer size is 4KB for fast-cgi.

    The plugin does not guarantee to run as the last software before returning a response meaning, other plugins or themes may add more headers. It’s basically a safety buffer. If you know that other software in your system does not add more headers you can increase the last 1KB as well.

    • This reply was modified 1 month, 3 weeks ago by  thellimist.
Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.