I'm working on an idea that i can't seem to find a good answer though hours and hours of searching,
I'm planning a small Canvas/WebGL Application this application will be using WebSockets to talk to a game server for syncing data to and from so think of it as a MMO type service
so im planning to have a queuing system to load assets E.G I make a request to get model1 and it's texture so that will quee
Mthd | Data | q | p | s
GET | /asset/model_1/model | 0 | 0 | 0
GET | /asset/model_1/texture | 0 | 0 | 0
GET | /asset/model_1/model | 1 | 1 | 0
GET | /asset/model_1/texture | 1 | 1 | 0
...
GET | /asset/model_1/model | 5 | 5 | 0
GET | /asset/model_1/texture | 5 | 5 | 0
Key
q = quality modifier
p = priority lower is better
s = status `0 not started, 1 downloading, 2 complete`
so my client is processing that download que however while this is going on another player has come into my view so i need that players model and texture so i add them to the que and end up like so
Mthd | Data | q | p | s
GET | /asset/model_1/model | 0 | 0 | 2
GET | /asset/model_1/texture | 0 | 0 | 2
GET | /asset/model_2/model | 0 | 0 | 0
GET | /asset/model_2/texture | 0 | 0 | 0
GET | /asset/model_1/model | 1 | 1 | 1
GET | /asset/model_1/texture | 1 | 1 | 0
GET | /asset/model_2/model | 1 | 1 | 0
GET | /asset/model_2/texture | 1 | 1 | 0
...
GET | /asset/model_1/model | 5 | 5 | 0
GET | /asset/model_1/texture | 5 | 5 | 0
GET | /asset/model_2/model | 5 | 5 | 0
GET | /asset/model_2/texture | 5 | 5 | 0
Now i'm wanting to cache these file into the browser cache so i'm tied between using the database and compressing using something like LWZ, or putting the assets online and using appCache and loading them.
So My Questions.
If i load an asset though the browser normally (http request) will the browser will keep that image in memory once it's no longer being rendered.
If i use Javascript to hold the base64 string should i then remove the string from the javascript variable (delete) i know it would free up the memory holding the string but would it free it all the memory used or would the browser still keep a copy of the image generated from base64 in memory.
Is it possible to write content loading through WebSockets into the appCache E.G the base64 string from the WebSocket Server.
Has any one found a better string compression system for Javascript other than LWZ i'm planning on compressing using a application at the server side so the only limit on compression is javascript supporting it.