WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] Caching wrong page (4 posts)

  1. zxb2
    Member
    Posted 3 years ago #

    I've run into an issue with W3 Total Cache's page cache system. It's caching the mobile version of my site, then subsequently serving the cached mobile page to users that visit the main page.

    I'm not sure how to reproduce it. Happens sporadicly. In order to fix it I have to restart PHP. All cache settings are set to use the XCache opcode.

    If it helps, here's a little background on my setup. Mobile users are directed to http://m.domain.com. Regular browsers can access this page as well. MobilePress changes the theme depending on two conditions. If the user visits that URL -- and also if their user agent matches that of a known mobile browser.

    A simple solution (in my eyes) would be to completely block caching on m.domain.com. Is there any way I can do this?

    For the time being I have disabled page caching and the issue has yet to surface again.

  2. zxb2
    Member
    Posted 3 years ago #

    Update. I've placed a cookie called "mobile" on the mobile page and added it to the rejection list. Seems to be working so far.

    EDIT: Nevermind spoke too soon.. happened again.

  3. zxb2
    Member
    Posted 3 years ago #

    Third time's the charm? Pinpointed a bug with my URL detection routine. Looks like I fixed it now. I'll update if it happens again (lol).

  4. Frederick Townes
    Member
    Posted 3 years ago #

    You can also simply add mobile user agents to the rejected user agents list on the respective tabs that you're using to avoid using cookies entirely.

Topic Closed

This topic has been closed to new replies.

About this Topic