• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 Prevent browsers from caching texture pages in HTML5

Coded Games

Member
So I have been having a problem since the dawn of time that GMS games will get their texture pages cached. This seems fine until you release an update and when everyone tries to play it all the graphics are glitched like crazy.

To get around this you tell everyone to clear their browser's cache and it fixes the problem. Is there any way that fixes this? I have tried everything that I can find on Stack Overflow and nothing solves the problem.

I am using GMS runtime 2.2.5.378. Here is the game in question so you can look at my HTML file: https://www.codedgames.com/games/cloud-constructor
 

FrostyCat

Redemption Seeker
Try configuring the cache headers on your server. Read more about them here, and consult the documentation of your server for instructions on setting them.
 

Coded Games

Member
I have tried all of the cache control headers here:

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

Unfortunately adding all of these did not prevent caching either.
 

FrostyCat

Redemption Seeker
I don't mean the meta tags in the index.html, I mean the HTTP headers that get served with the images when your game issues an HTTP request to them. I got the stale images you were talking about off my first ever load of the game, so it's not the browser-side cache. Consult your server's documentation and learn to tune its cache settings.
 

Coded Games

Member
I don't mean the meta tags in the index.html, I mean the HTTP headers that get served with the images when your game issues an HTTP request to them. I got the stale images you were talking about off my first ever load of the game, so it's not the browser-side cache. Consult your server's documentation and learn to tune its cache settings.
Yes looking into it now. Made some changes to .htaccess that should disable caching. But it also appears that when you remove the "www" in the link it does not served the cached version.
 
Top