Desktop/Mobile Problem Solved?

Hey guys, so one of the benefits (and reasons) why I slowed down slightly was so I would also have more time to do maintenance on the website. The desktop showing on mobile/mobile showing on desktop problem has been one of the most persistent, annoying problems that I have encountered to date. Some tech friends were convinced that it was SuperCache, but after turning it off and even uninstalling it the problem still persisted. After nagging at it for a few hours today (early release from work, woo), I -THINK- however that I have located the problem.

As it turns out, Bluehost uses a ‘server level cache’ method called ‘Varnish’, which in the configuration that Bluehost uses, is unable to differentiate between ‘mobile users’ and ‘desktop users’ when saving the ‘cache’. So what happened was if the ‘latest’ version of the ‘cache’ which Varnish had was a mobile version, even when a desktop user accessed the site, they would still be issued the saved, mobile ‘cache’, because Varnish didn’t distinguish between ‘mobile’ and ‘desktop’, only caring about whether or not it was the ‘latest’ cache or not. However, the ‘cache’ was not served to people who were logged in, which is why only people who were NOT logged in would encounter this problem.

At present, Bluehost is not willing to modify the Varnish cache (because they are trying to use identical settings for all their websites), so I have gone ahead and completely disabled Varnish. This is going to have two results:

1) Increased server load because the server cache is gone. I might have to upgrade the server to compensate, and/or get a second CDN to support Cloudflare, and:
2) Get rid of the problem with the mobile/desktop versions interchanging.

Anyhow, I’m not 100% sure, but I THINK this is it. So everyone, please keep your eyes peeled to see if the bad old problem still exists. If I can verify that it is gone, I will leave Varnish off, then pay extra if needed to make up for the extra server load with it gone. Thanks for your help, guys!

Posted by RWX

50 thoughts on “Desktop/Mobile Problem Solved?” - NO SPOILERS

  1. I had the problem even when I wasn’t logged in though. Let’s see if it disappears, thanks for your efforts Ren.

    Edit: Even when I was logged in*

      1. I edited the post, it was a typo 😀
        Anyway, it happened both when I was logged in and logged out, but maybe your fix solved. FYI, I was using a laptop and half the time the site displayed the mobile version, half the time the desktop one.

        1. Eh I was on a desktop and it was the same for me half of the time mobile and the other half the desktop one, the only way I managed to keep it in desktop was to use the “Dark” :/ it hasn’t happened for a while though (I have not used my phone to read here in a long time though.. :/ that might be it)

  2. …I’ve never had a problem aND I used this exclusively on mobile, that being said mobile websites are shit and I used the desktop versions regardless if I’m on my phone

    1. Hey, I just realized I missed you and didn’t welcome you to the community back in March. So um…welcome to the community, Synvaris! 🙂

    2. I agree with this. I always set my mobile browsers to spoof the desktop versions of websites. Mobile versions of websites 9/10 cut out menu options and the like to save space, which irritates me. In the age of pinch-zooming and text reflow, it seems like such a waste 🙂

      Disable the mobile version Ren, and save some $$$ by not having to upgrade your hosting package! If you are unsure whether the user base would like/dislike that change, why not post a poll and ask?

      Just a thought.

      1. The trouble is that some of us have phones and browsers that don’t wrap text, so it sometimes makes it impossible to read desktop version, especially if you can’t Zoom.
        I only had the problem a couple of times a few weeks back though, and I think I just tried to read the chapters somewhere else

  3. I used to have that problem but since I’ve kept myself logged in all the time it’s never been a problem at all. Hopefully it is fixed once and for all now though

    1. Yeah, the problem is, only around 10% of the readers are logged in; 90% have never registered (according to my stats) so I imagine they were being driven crazy! Hehe.

      1. It certainly drove my crazy. Was constantly refreshing the page until it was showing in mobile version. Btw Ren where do you live? The post time for when chapters are uploaded is not what the time is here in the UK.

  4. I use only desktop and I haven’t encountered the mobile version in perhaps over a month. I can’t stay logged in for some reason, so I’ve been in both situations without getting the other version for a long time now.

  5. Hmm, i just remembered something extremely important, almost as important as getting third comment in a new chapter … were i welcomed when i joined the “community” a few months ago?

  6. i had this problem when i first discovered this website a few months ago. but one day it just disappeared. i still remember refreshing the page 100 times because i refused to read in a mobile format. it sucks that others still have this problem.

  7. Hi Ren, thanks for translating this wuxia/xianxia, I really enjoy it.

    Varnish doesn’t distinguish between desktop and mobile version because it is usually done by the browser via css instead of by the server. Doing it in css lower the load on websites (offering only one version of the page, same cache everywhere, etc).

    1. Thanks for joining the community and for the advice, OrangePizzaPie! You are absolutely right. The way wuxiaworld’s ‘mobile theme’ works though is that it is actually a separate css stylesheet, instead of there just being one fully responsive stylesheet, hence the need for Varnish to be able to distinguish by User-Agent. One day hopefully, we’ll have a true, fully responsive single-sheet theme, but that has its own set of disadvantages (esp. with ads) as well 🙂

  8. I view the site from Chrome on iOS 8, logged in. Currently, I have absolutely no problems with your site whether on wifi or lte.

    I thought switching to Chrome fixed the issue for me, but I realize I started logging in at the same time.

    Thanks for the great work.

  9. Just in the past hour or two I have been having a problem. When refreshing or changing pages I have gotten “Error establishing a database connection”. And I had gotten the mobile version when I read on desktop before but ultimately didn’t care.

    1. After my previous post I got “Website is offline

      No cached version of this page is available.
      Error 504 Ray ID: 1d10d18c6bd0185e • 2015-04-03 00:58:18 UTC “. If Varnish prevented both then I think it would be better to keep. If people have problems when not logged in then the should register and login.

      1. Nah, this is a coincidence. Cloudflare itself seems to be doing something weird. Bluehost guys seem convinced it’s a Cloudflare problem. Maybe I should just switch to a paid CDN, seriously…

  10. you somehow broke my using Commodo Icedragon internet browser with your cloudflair when other cloudflair sites work fine…. its a forever wait refresh wait….. i only made a account to say this cause now it severely hurts my ability to read i had to download another internet browser just to access the site which is now slow as a snail to me….. and i refuse to switch internet browsers so im screwed 🙁

    http://i.imgur.com/hvdmkcD.png

    1. Don’t worry such heavy load only happens around release time of most expected chapters, like the following one 😛 Everyone wants to read it so a loooot of people are F5’ing at once xD

      1. the problem is i cant access the website at all with my preferred web browser it just repeats whats in that screenshot just changes the id letters for the session and i dont think its the load cause i can access it with another web browser. so now im using a web browser im not used to 🙁 and royalroadl still works and thats cloudflair also so its not the service in general that wont work with the browser

  11. To be blunt, the autodetect browser action/delay is a little annoying. Would it be easier to switch to desktop by default? You can add a button or link to the mobile version. Just a suggestion.

    1. IECherries, we are currently under a DDOS attack on our server. The ‘autodetect browser’ is something which Cloudflare is putting in place to validate every request to the server, but it should only be a ‘one time’ thing. It has nothing to do with this desktop/mobile thing.

  12. hey Ren i hate to be “that guy” but i have to ask will this effect chapter releases today and or keep effecting it till the kid[presumably(not saying you arent getting ddosed was referring to me assuming its a child ddosing you)] stops ddosing you?

  13. I’ve never gotten the mobile on desktop problem, but I got the desktop on mobile issue about 4/5 of the time I was on my phone. I haven’t been logged on most of the time for either device, but it seems fixed on mobile so far. Haven’t gotten the desktop version to appear after visiting a few pages.

  14. Thank you for finally fixing this annoying problem.
    Also a big thank you for all the work on this translation so far.

    To me it sounds like the proper solution to this problem would be to only have one website version which looks good on both mobile and desktop.
    I never made a WordPress theme, so I am not sure about it, but in normal HTML with CSS you can use media queries to change how the website looks based on screen size. Which is far more reliable than trying to detect what kind of browser is accessing your site.
    The big advantage of this technique is that it doesn’t matter how the caching works, since the looks of the website are only changed by the browser based on screen size and all browsers recieve the same version.

    1. Hi jinkourai, welcome to the community! So far, it looks like no one has posted to say they still have this problem, so it looks like it is fixed! Yay!

      You are absolutely right, but unfortunately, I’m not a coder, and while MiPo has been awesome, I don’t want to try and impose on him any further. One day!

    1. Hi zelle, welcome to the community! That is a function of the Cloudflare super-high defense settings that I am forced to use due to being under a DDOS attack. The Varnish cache has nothing to do with that. Cheers!

  15. The fix seems to be working for the past few days. I viewed this site on both mobile and desktop, both with Firefox browser. But today, for the first time in a while, on my phone I got the full site, and on desktop I got the mobile site. This is for chapter 26 and 27 (spoilers page).

    1. Yes, ananda, I just turned it on again literally an hour ago, just to double check to see if it really was this problem. It looks like it is ;). I just shut it down again.

      Right now, the situation looks like Varnish cache ameliorates the DDOS problem, but the DDOS problem is still there; even with Varnish on and my security settings set to ‘high’ for Cloudflare, I’m still getting a server load hovering around ten (which slowly climbs). So far, only having security settings set to “I’m Under Attack” seems to resolve the problem.

Leave a Reply