How do I clear my android app cache data from the game?

0 favourites
  • 6 posts
From the Asset Store
Basics sprites and tilesets to build a platformer game or prototype
  • Hi everyone! A long time user of C2 and C3 but the first time posting here :)

    I'm building a classic tile swap puzzle game using images from a website.

    My appbundle is around 4.5mb and I love it!

    But when the player plays each image (thumbnail and image level) ends up adding "plenty" of weight to my 4.5mb app.

    The idea behind the game is to have thousands of levels so this might become a problem for the engaged player.

    Is there a way to clear the cache every now and then from the code? Or maybe disabling the cache at all.

    Thanks in advance!

    You can try it out joining my google play's internal track.

    play.google.com/apps/internaltest/4699065115675243092

  • I don't understand why any images would be saved in cache when you are simply playing the game. Do you have ads in your game?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't understand why any images would be saved in cache when you are simply playing the game. Do you have ads in your game?

    I do! But i'm pretty sure it's not because of that (i'll double check).

    Also I feel images are being cached because they load faster the second time I request them.

    Btw, I use images from Unsplash.com.

  • Edit: sorry, I just realized your game is downloading images from that website in runtime..

    There is a Cordova plugin you can try.

  • If you request URLs at runtime in your app, the server response may be telling the browser engine to cache the response in case it needs to request the same URL in future. So you might be able to avoid these resources being saved to the cache in the first place by adjusting the server HTTP response. For example if you add Cache-Control: no-store that will tell the browser engine not to save the response in the cache. However the flip-side is it then means every single time it requests that URL it will go to the server repeatedly instead of using the cache.

  • If you request URLs at runtime in your app, the server response may be telling the browser engine to cache the response in case it needs to request the same URL in future. So you might be able to avoid these resources being saved to the cache in the first place by adjusting the server HTTP response. For example if you add Cache-Control: no-store that will tell the browser engine not to save the response in the cache. However the flip-side is it then means every single time it requests that URL it will go to the server repeatedly instead of using the cache.

    The no-store is something I can use from the client side? I'll do some research. Because I can't change Unsplash.com http cache options. Maybe if I use an intermediary layer with our own server. We'll look into this. Thanks Ashley!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)