mysql queries & cache - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql queries & cache (
/showthread.php?tid=663698)
mysql queries & cache -
AhmedMohamed - 09.02.2019
When first query executed and I used its results, should I have to use cache_delete(result) to make the cache empty so I can use it again? - or I can make first query and use its results then make second without delete first and use its results.
Re: mysql queries & cache -
ComDuck - 09.02.2019
Show a code example of what you are talking about. You only use cache_delete to delete the cache from memory if you have specifically used cache_save/cache_set_active somewhere in your code. If that is not the case (not using cache_save), then the cache usually gets cleared when you successfully finish running a callback at point
return 1.
Every player or event (depending on your code) is assigned a unique cache ID, usually. Although you can choose not to delete the player/event cached data, that would be horribly inefficient as the memory used won't be freed once the event has stopped or the player is no longer on the server.
Re: mysql queries & cache -
AhmedMohamed - 09.02.2019
This is answered my question, Thanks