Forums

WP Super Cache
WP Super Cache won't work on a site requiring Windows Authentication (4 posts)

  1. ultradust
    Member
    Posted 1 year ago #

    I am wanting to implement Super Cache on a site which is managed under version control and staging practices. I must demonstrate its functionality on our dev site prior to deploying to staging and production.

    Our dev and staging environments are password protected via Windows Authentication. I discovered today that, when running Super Cache on those environments, I get the famous error "The pages do not match! Timestamps differ or were not found!" and the resultant cache pages describe an authentication problem resulting in a 401.2 error.

    What is happening is that Super Cache doesn't generate appropriate authentication headers when it requests the PHP pages for caching, so our server rejects the requests and Super Cache ends up creating a cached version of the error responses. Effectively, Super Cache doesn't authenticate like a browser, so it doesn't get real pages to cache.

    Is there any way to work around this? When we turn off password protection to the site, Super Cache works, so it's definitely just this authentication issue. But we need to keep the password protection on, and yet we must demo the Super Cache functionality to our management in dev and staging.

    Can anyone help with this quandary?

  2. Donncha O Caoimh
    Member
    Posted 1 year ago #

    Test the caching manually. Load the front page, view source and then reload and make sure the timestamp is the same. That's all the tester does.

  3. ultradust
    Member
    Posted 1 year ago #

    Hi donncha - thanks for your reply.

    Manually testing, the timestamps are the same.

    However, when I run the test, the two .html files generated in the cache folder themselves basically contain an error report instead of pages.

    Are you suggesting that the process that WP SC runs to do actual caching is fundamentally different than the one used to generate the test files, such that the caching works fine even when the test fails due to failing authorization? How can I test this to be sure?

  4. Donncha O Caoimh
    Member
    Posted 1 year ago #

    Yup, they're completely different. The tester requests a page from the site, while the caching mechanism creates the cache file in the same process that creates it. No need to worry about authentication.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic