Support » Plugin: WP Super Cache » CDN stopped working in v1.5.x

  • Resolved LucasRolff

    (@lucasrolff)


    Hi,

    We host some quite big websites that receive millions of requests every day – majority of our customers make use of WP Super Cache and also uses our in-house CDN (very standard pull CDN) – it has been working great for a long time – until recently when WP Super Cache version 1.5 has been released – despite the CDN actually has the offsite URL defined and “CDN Enabled” is set to yes – the actual rewrite never happens.

    This means we’re experiencing a huge increase in origin traffic (all static files) which does put extra load on our systems.

    We tried downgrading one of the sites to an older version that we had laying around (1.4.9) – and here everything started working again, and URL rewrites happen as they should.

    The sites very basic, it’s basically blogs or news sites, there’s no magic going on in terms of configuration both on WordPress side, but also in WP Super Cache settings.

    We used to use the .htaccess rewrites, and from my understanding, this has now been renamed to “Expert mode” – we don’t cache pages for known users – and here it actually will do the rewriting – where if you hit the cached pages – the rewrite will not happen.

    It seems like the rewrite isn’t done before the page cache file is generated – thus causing the issues.

    Also the “Mod Rewrite Rules” always shows as if they’re not installed despite them being installed – but that’s another issue.

    Is there any known issue / resolution regarding this that we can implement ourselves temporarily until a new update will be released?

    It might be worth mentioning:
    siteurl is something like http://domain.com/wp
    home is something like http://domain.com/

    It has always been like that, and has always been working – for CDN url we’ve been using something like http://cdn.domain.com/wp – and all of a sudden in 1.5 – this stops working – and rewrites just isn’t processed by any means.

    Thanks in advance.

    • This topic was modified 3 years ago by LucasRolff.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Donncha Ó Caoimh

    (@donncha)

    I enabled the CDN feature on my own blog and it is working. Can you disable and enable it from the CDN tab of the settings page, just in case some setting hasn’t been saved correctly?

    Can you enable the debug log on your site and check if there’s anything unusual there. Unfortunately the CDN function doesn’t have much logging added to it though.
    Can you try copying the file, ossdl-cdn.php from version 1.4.9 over the one in the latest version? Does that help?

    LucasRolff

    (@lucasrolff)

    Hi @donncha,

    > Can you disable and enable it from the CDN tab of the settings page

    I’ve tried disable and enable the CDN feature, caching on the main page, simple/expert caching and even disable and enable the plugin.

    > I enabled the CDN feature on my own blog and it is working.

    Not sure if you saw my update to the comment:

    It might be worth mentioning:
    siteurl is something like http://domain.com/wp
    home is something like http://domain.com/

    It has always been like that, and has always been working – for CDN url we’ve been using something like http://cdn.domain.com/wp – and all of a sudden in 1.5 – this stops working – and rewrites just isn’t processed by any means.

    > Can you try copying the file, ossdl-cdn.php from version 1.4.9 over the one in the latest version? Does that help?

    Using the ossdl-cdn.php from an older version will make it work again.
    If I do a git diff, I can see that $ossdl_off_blog_url changed from “siteurl” to get_home_url()

    (Also my suspicion from the above that “siteurl” and “home” differs in these setups our customers run – sadly not something I can change)

    So it used to rely on siteurl – and now it rely on home url – and that seems to break – at least older installations.

    Enabling debug logging didn’t show any odd things.

    Plugin Author Donncha Ó Caoimh

    (@donncha)

    The change was in #26 from a long time ago which was supposed to fix things for sites like yours.

    We might need to add another setting to the CDN tab, or perhaps just a setting you can change in the config file to switch around those URLs.

    LucasRolff

    (@lucasrolff)

    Sure the change in git was done long time ago, but was first merged and a part of 1.5.0

    https://github.com/Automattic/wp-super-cache/compare/1.4.8…1.5.1#diff-956b60621a3efdc27fc0b7cb2232a82c

    1.5.0 was released 6 days ago – so it’s a pretty recent change if looking at the version numbers.

    1.4.9 (which also contained the get_option(‘siteurl’) – was released in early feb 2017.
    But what I really care about is that WP Super Cache works 🙂

    > We might need to add another setting to the CDN tab, or perhaps just a setting you can change in the config file to switch around those URLs.

    Setting it somewhere in the config would be nice indeed, I personally don’t mind that I have to change a file on the filesystem to get the thing working.

    What I’ve done for now is to use the old ossdl-cdn.php to at least offload things correctly.

    Plugin Author Donncha Ó Caoimh

    (@donncha)

    I’m going to revert the change to $ossdl_off_blog_url so it’s set to siteurl, and add a note telling users they can change the siteurl used by the CDN code using the filter “ossdl_off_blog_url”.

    Have a look at the top of the file – you could use that on your own sites now. Create a filter on “ossdl_off_blog_url” and have it return the correct siteurl of the blog.

    Plugin Author Donncha Ó Caoimh

    (@donncha)

    Changes reverted in #319. Plus a warning note to users who have differing siteurl and homeurl settings.

    LucasRolff

    (@lucasrolff)

    Awesome! Thank you a lot!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘CDN stopped working in v1.5.x’ is closed to new replies.