Forums > Bugs > Random game search is bugged
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.
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.
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.
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.
CalaisianMindthief (8172) on 3/16/2014 6:34 AM · Permalink · Report
I still have problems with the button even after clearing the cache.
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...
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.
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--]
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
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.
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
-
Change HTTP status code to 302 ; again see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3 why: "... Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. ..." This already sounds very good, but read on.
-
If brave, change to HTTP status code 307: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8
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
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. :-)
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.)
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 :)
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.
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
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...
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.
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.
Indra was here (20752) on 7/6/2014 2:50 PM · Permalink · Report
Me thinks you're high, dude.
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.
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.
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.
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.
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.
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?
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