Forums > Bugs > Random game search is bugged

user avatar

Highretrogamelord89 (174) on 3/8/2014 5:28 PM · Permalink · Report

I click on "Random game" (the 2 arrows) and get a random game. Good. However, if I click it again I get the same game again and again and again.

Sometimes if I click on the MobyGames logo it helps to give me another random game, but that only works very rarely.

user avatar

Nélio (1976) on 3/8/2014 6:45 PM · Permalink · Report

That's strange. You're not the first one complaining, but I've never witnessed that behavior. What browser are you on?

user avatar

Highretrogamelord89 (174) on 3/8/2014 7:09 PM · Permalink · Report

[Q --start Nélio wrote--]What browser are you on?[/Q --end Nélio wrote--]

Firefox.

Never had that problem before. Just now since 3 or 4 days.

user avatar

Tracy Poff (2094) on 3/8/2014 9:12 PM · Permalink · Report

For me, this bug is present with Firefox, but not Chrome. Which I think someone else said elsewhere, so it may be relevant.

user avatar

Nélio (1976) on 3/8/2014 9:50 PM · Permalink · Report

It was me. :P

user avatar

Rola (8483) on 3/8/2014 11:02 PM · edited · Permalink · Report

What is relevant is browser cache. I did a test. I also had the same result when clicking random game... but new title was given when I restarted the browser. Next I manually cleared the cache - new title.

(old Opera 12 here)

user avatar

MobyReed (325) on 3/10/2014 1:34 AM · Permalink · Report

Weird... I guess Firefox is more aggressive with how it handles caching. Will have to look into that.

user avatar

jlebel (2190) on 3/10/2014 8:59 PM · edited · Permalink · Report

I'm getting this problem now as well. It had always worked for me until about 5 minutes ago. I had been using it this morning and this afternoon successfully, and it suddenly started bringing up the same game. It's like I hit a finite limit of random game selections allowed per session.

This is a feature I use daily.

EDIT: Restarting Firefox did nothing for me. Clearing the cache did help.

user avatar

CalaisianMindthief (8172) on 3/16/2014 6:34 AM · Permalink · Report

I still have problems with the button even after clearing the cache.

user avatar

ingapseu (254) on 3/16/2014 12:10 PM · Permalink · Report

The same for me. Always the same game independently how often I press the button. I use also Firefox and it worked for me in the last days normal, until now.

user avatar

MobyReed (325) on 3/17/2014 3:24 PM · Permalink · Report

Been digging into this, but not much luck so far. It's a slow process since it only occurs on the production site. Doesn't happen on the dev server nor locally. It must be something related to caching, but why it's only Firefox is a mystery...

user avatar

Rola (8483) on 3/17/2014 5:41 PM · Permalink · Report

[Q --start Reedx wrote--]only Firefox[/Q --end Reedx wrote--] ahem, read my post above

user avatar

Nélio (1976) on 3/17/2014 10:44 PM · Permalink · Report

Question to those having the issue: if you type in the random game link directly into your browser, do you get a random game?

http://www.mobygames.com/random/game

If it always shows the same game, try adding a dummy parameter at the end:

http://www.mobygames.com/random/game?dummy=yadda

If this solves it, then a fix will be fairly easy.

user avatar

Rwolf (22837) on 3/17/2014 11:12 PM · edited · Permalink · Report

Excellent, the dummy parameter fixed it for me! Thankyou Nélio! (using Firefox btw)

edit: in Firefox 27, using the same dummy parameter gives me a new random game every time I tried, unlike what Opera seems to do.

[Q --start Nélio wrote--]Question to those having the issue: if you type in the random game link directly into your browser, do you get a random game?

http://www.mobygames.com/random/game

If it always shows the same game, try adding a dummy parameter at the end:

http://www.mobygames.com/random/game?dummy=yadda

If this solves it, then a fix will be fairly easy. [/Q --end Nélio wrote--]

user avatar

Rola (8483) on 3/18/2014 12:06 AM · Permalink · Report

Opera 12: with parameter it did pick another game than without. But the title stays the same with the same parameter.

user avatar

Nélio (1976) on 3/18/2014 12:32 AM · Permalink · Report

I was afraid of that. Having a random parameter be generated each time would solve it, but it's more a hack than a proper fix.

user avatar

MobyReed (325) on 3/18/2014 1:02 AM · Permalink · Report

Yeah, considered just adding a random or time-based param to it, but didn't want to do that. It's kind of an ugly hack.

user avatar

Nélio (1976) on 3/18/2014 3:04 AM · Permalink · Report

What exactly changed in there with the redesign? Isn't it linking to the same address?

user avatar

Highretrogamelord89 (174) on 3/19/2014 2:21 AM · Permalink · Report

[Q --start Nélio wrote--]

If it always shows the same game, try adding a dummy parameter at the end:

http://www.mobygames.com/random/game?dummy=yadda

If this solves it, then a fix will be fairly easy. [/Q --end Nélio wrote--]

This is brilliant! :O

user avatar

Gao Eraya on 4/20/2014 12:21 PM · Permalink · Report

[Q --start Nélio wrote--]Question to those having the issue: if you type in the random game link directly into your browser, do you get a random game?

http://www.mobygames.com/random/game

If it always shows the same game, try adding a dummy parameter at the end:

http://www.mobygames.com/random/game?dummy=yadda

If this solves it, then a fix will be fairly easy. [/Q --end Nélio wrote--]

The last hint helped. Thanks.

user avatar

Nélio (1976) on 4/21/2014 11:41 AM · Permalink · Report

This was supposed to have been fixed. Is the bug back?

user avatar

Cavalary (11445) on 4/21/2014 2:20 PM · Permalink · Report

As far as I can tell, none of the caching issues have been fixed. Keep getting the same page unless I manually refresh (and of course you can't manually refresh on random game), with all the obvious effects of that. No news is... no news.

user avatar

Nélio (1976) on 4/21/2014 2:55 PM · Permalink · Report

I assumed it after Reed's post about the caching issues being fixed. But yeah, I now remember your reply saying that some issues were back. :|

user avatar

feisty on 12/6/2014 9:02 AM · edited · Permalink · Report

Took a look into it (so far it's possible from the outside), web developer here.

http://www.mobygames.com/random/game returns a 301 status code, please read http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2 :

"... This response is cacheable unless indicated otherwise. ..."

When I look at the header, is see no indication it should not be cached (see below); my take on it: Firefox has the right (according to RFC) to cache so it does.

http://www.mobygames.com/random/game
Resolving www.mobygames.com... 162.159.250.219, 162.159.249.219, 2400:cb00:2048:1::a29f:f9db, ...
Connecting to www.mobygames.com|162.159.250.219|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 301 Moved Permanently
Date: Sat, 06 Dec 2014 09:10:59 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Last-Modified: Sat, 06 Dec 2014 09:12:14 GMT
Location: /game/supervision/delta-hero
Vary: Accept-Encoding
Via: 1.1 www.mobygames.com
Server: cloudflare-nginx
CF-RAY: 19475a79ff660a1e-VIE

As to way Firefox does not cache when appended a query string: that I'm not entirely sure but browsers a are known to handle urls with query strings differently sometimes so I wouldn't be surprised.

Proposed solutions:
- add "no caching" headers, i.e.

Cache-Control: no-cache, no-store Expires:

This is a "internet current practice" solution but probably not technically necessary the most correct, read on why

IMHO this would be "technically the most correct one"

The difference between 302 and 307: 302 is supposed to be used for workaround redirects after POST requests (the clause for 302 includes it shouldn't automatically redirect for GET and HEAD requests) where 307 is exactly the applicant thing for this case.

TL;DR: switch status code to 307

user avatar

Cavalary (11445) on 12/6/2014 11:41 AM · Permalink · Report

Awesome explanation there.

And it does the same thing if you append a string if it's the same thing, it only reloads if you keep adding different ones, which is just what should happen, as it's a different URL, not the cached one.

user avatar

feisty on 12/6/2014 6:34 PM · Permalink · Report

[Q --start Cavalary wrote--] And it does the same thing if you append a string if it's the same thing, it only reloads if you keep adding different ones, .... [/Q --end Cavalary wrote--]

I expected that too, but as I wrote actually at least in my Firefox it doesn't cache. I.e. for me the "dummy" url always returned a different game nevertheless.

But still it would be a workaround. And for sake of performance and cachability for non-auth request you want all of the pages the same; they're using cloudflare for a reason. It could be done with Javascript too, appending the random query after the page is loaded. But that still is a workaround for something which should be fixable by using existing standards/recommendations. :-)

user avatar

Cavalary (11445) on 12/6/2014 10:41 PM · Permalink · Report

You're right. Hadn't tested in FF in a while, apparently recent versions don't cache if you append something (would that mean it never caches pages generated from post ids or such?). IE does though. And it is just what it should do for a 301 redirect after all. (Never knew about 307 though.)

user avatar

feisty on 12/8/2014 12:25 PM · Permalink · Report

Regarding the differences in caching: there are no explicit caching headers thus the behavior, albeit specified in the RFC(s), it still kind of "what the browser thinks".

Explicit cache headers are less of an issue but then it comes down to details that browsers interpret "Cache-Control: no-cache" not always the same and same variants of IE need "Cache-Control: no-cache, no-store", etc.

Ok, sorry it's going to be off-topic and I got carried away; I've spent way to much time figuring out and fixing those annoying cache/header problems in too many browsers.

I really like the site so I hope I can contribute my 2c :)

user avatar

Cavalary (11445) on 3/19/2014 10:59 PM · edited · Permalink · Report

This seems to be only a symptom of some quite forced site caching overall. As of some updates ago, pages don't usually load anew on their own, just get the cached version and need to refresh manually in most cases. (And yeah, in the random game case, same dummy parameter results in same game, different one in another.)

Quite an issue on the forums, not just needing to refresh to see threads with new posts but to know whether you need to refresh the thread itself to see said new posts (don't refresh it, they may not be there, do refresh it without checking, the "new" icon will be gone if it somehow did load right the first time).
And just earlier had it bite me when editing a post twice. It reloaded the original version from cache when I edited it the 2nd time, so after posting I noticed that I had the addition I had made in this 2nd edit, but lost the change from the first.

Oh, right, IE11.

user avatar

Nélio (1976) on 3/20/2014 5:23 AM · Permalink · Report

Another proof of this are the approval notifications. The main page says you have notifications, you click on the link, view them, close, and back to the main menu it still says you have notifications. Have to force a refresh for it to go away.

user avatar

MediaCult (190) on 7/15/2014 10:02 AM · Permalink · Report

[Q --start Cavalary wrote--]This seems to be only a symptom of some quite forced site caching overall. As of some updates ago, pages don't usually load anew on their own, just get the cached version and need to refresh manually in most cases. (And yeah, in the random game case, same dummy parameter results in same game, different one in another.)

Quite an issue on the forums, not just needing to refresh to see threads with new posts but to know whether you need to refresh the thread itself to see said new posts (don't refresh it, they may not be there, do refresh it without checking, the "new" icon will be gone if it somehow did load right the first time).
And just earlier had it bite me when editing a post twice. It reloaded the original version from cache when I edited it the 2nd time, so after posting I noticed that I had the addition I had made in this 2nd edit, but lost the change from the first.

Oh, right, IE11. [/Q --end Cavalary wrote--]

Noticed the same thing, using Firefox 30.0

user avatar

Alexander Zdenka (1) on 5/15/2014 8:00 PM · Permalink · Report

I click on "Random game" (the 2 arrows) and get a random game. And if I click it again I get the same game again and again and again...

user avatar

Indra was here (20752) on 7/6/2014 2:25 PM · edited · Permalink · Report

Prayer received. Added to Considered - Category: Homepage - Random Game - Same Results.

user avatar

Pseudo_Intellectual (66423) on 7/6/2014 2:38 PM · Permalink · Report

There are some places on the site that accept a limited selection of GIF, JPG, PNG and/or BMP... ideally everywhere that accepts graphics would accept all of these kinds.

user avatar

Indra was here (20752) on 7/6/2014 2:50 PM · Permalink · Report

Me thinks you're high, dude.

user avatar

Pseudo_Intellectual (66423) on 7/6/2014 4:16 PM · Permalink · Report

Huh, I could have sworn I was posting this in a relevant forum, but clearly not.

user avatar

Spiderkeys (188) on 8/17/2014 1:14 AM · Permalink · Report

Well it's working for me with yabba http://www.mobygames.com/random/game?dummy=yadda at the end, I just created a link at my desktop.

Finding is very useful, but would be much better if we could filter out, systems we don't want to see, me being more of a retro gamer, it's little tiring with Playstation 3 and Xbox 360 Games showing up all the time.

user avatar

feisty on 8/18/2014 8:21 PM · Permalink · Report

Same problem here. Firefox always gets the same game, Chrome gets random ones. Heck, this is even true on my mobile Android.

user avatar

Indra was here (20752) on 5/10/2015 4:40 PM · edited · Permalink · Report

Aww, great. Now I have this problem. Stuck at Chocobo's Dungeon 2. Coincidently, the game has multiple descriptions.

While using the http://www.mobygames.com/random/game? approach, I keep getting Die by the Sword.

user avatar

Victor Vance (18107) on 5/10/2015 7:11 PM · Permalink · Report

Funny thing is that those of us who have this bug get individual entries. My current "random" game is Megami Tengoku II. It seems to change every few weeks.

user avatar

Nélio (1976) on 5/10/2015 10:19 PM · Permalink · Report

My random game is VIP.

puts on glasses, walks away

user avatar

Nélio (1976) on 5/29/2015 11:42 PM · Permalink · Report

Ok, this one is sorted. :-)

I had to resort to a hack, but it works like a charm. Should go live in the next update.

Seems like this is intended behavior after all. It's just the way the button was implemented. Browsers simply got "smarter" over time and started caching URL redirects, which is basically what the button does. What I did was force the button to have a unique URL every time a page is loaded.

user avatar

Indra was here (20752) on 6/2/2015 10:10 AM · Permalink · Report

It miraculously works now for me. You updated this, Nelio, or did the bug gain AI and went into hiding?

user avatar

Nélio (1976) on 6/2/2015 10:15 AM · Permalink · Report

Didn't you read the previous post? :P

user avatar

Indra was here (20752) on 6/2/2015 10:31 AM · Permalink · Report

[Q --start Nélio wrote--]Didn't you read the previous post? :P [/Q --end Nélio wrote--]Was waiting for the 'next update' post. Er. Did I miss it? o_o

user avatar

Rola (8483) on 6/2/2015 2:44 PM · Permalink · Report

Yes.

I report that even old Opera 12 and ancient Firefox 3.6 properly fetch random games! Hats off to you, Nélio!