Be a Supporter!

How does one get around cache-ing

  • 358 Views
  • 6 Replies
New Topic Respond to this Topic
dartosgamer
dartosgamer
  • Member since: Jun. 26, 2012
  • Offline.
Forum Stats
Member
Level 04
Game Developer
How does one get around cache-ing Sep. 7th, 2012 @ 03:31 PM Reply

I need to make some updates to my game to fix some balance issues but in order for the player to see these changes he has to clear his cache. This is kind of annoying and I think a lot of people don't know how to do that.

Is there anyway around this or is that just the way life is?


I gave it a shot and for some magical reason all is well. Thank you good sir.

Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to How does one get around cache-ing Sep. 7th, 2012 @ 03:58 PM Reply

Adding these meta tags to your <head> container should work.

You could also ensure that the URI to your game is always unique upon making changes. For example you could store your main game page on sweet_game.html and use an .htaccess file (assuming you're using Apache server) to access it:

RewriteRule ^SweetGame/?$ /path/to/sweet_game.html

(more on .htaccess rewrites here)

Then, if you ever update the game you can rename sweet_game.html to sweet_game_1.html, and update your .htaccess file to accommodate. And just continuously increment the integer in the filename for each update made.
This would only need to be done for production pages, as you can just manually disable caching on your browser for your development pages (at least you should have both a production environment and a development environment).
That way your users will always have the same URI, which gets redirected (silently, behind the scenes; they won't notice) to the most up-to-date version of the game.

There's probably more ways to do it, but those two are the only ways I can think of right now.

dartosgamer
dartosgamer
  • Member since: Jun. 26, 2012
  • Offline.
Forum Stats
Member
Level 04
Game Developer
Response to How does one get around cache-ing Sep. 7th, 2012 @ 04:01 PM Reply

I am coding this all in flashdevelop so I have no <head> tags...

But I see version control in the API wiki but I can't seem to find where the newVersion flag is.


I gave it a shot and for some magical reason all is well. Thank you good sir.

Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to How does one get around cache-ing Sep. 7th, 2012 @ 04:04 PM Reply

At 9/7/12 04:01 PM, dartosgamer wrote: I am coding this all in flashdevelop so I have no <head> tags...

Ah, I thought this was an HTML5 game. Flash/ActionScript related questions go in the Flash forum.
However: how is your SWF being deployed? If it's being cached then that means you must be displaying it on a web page, which means you should have a <head> element.

dartosgamer
dartosgamer
  • Member since: Jun. 26, 2012
  • Offline.
Forum Stats
Member
Level 04
Game Developer
Response to How does one get around cache-ing Sep. 7th, 2012 @ 04:05 PM Reply

I am displaying it here at newgrounds. Sorry wrong forum as i see


I gave it a shot and for some magical reason all is well. Thank you good sir.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to How does one get around cache-ing Sep. 7th, 2012 @ 05:59 PM Reply

At 9/7/12 04:05 PM, dartosgamer wrote: I am displaying it here at newgrounds.

You don't have a website? A free host? A blog?


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
NinoGrounds
NinoGrounds
  • Member since: Nov. 28, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to How does one get around cache-ing Sep. 9th, 2012 @ 04:27 PM Reply

At 9/7/12 05:59 PM, egg82 wrote: You don't have a website? A free host? A blog?

Yes, that was pointless