I'm currently trying to speed my web app for mobile devices a little bit up, but now I'm stuck at the most important part - caching. How is it possible to cache a entire layer right before the user starts to drag it and revert it back to usable Kinetic.Nodes when the drag-action has stopped?
At the moment I start caching on
stage.on('mousedown touchstart', function(){ // CACHING})
but the problem here is, that the user has to perform a second mousedown touchstart
event to "grab" the cached image, which, of course, starts a new caching.
In this case my questions would be:
How can I pass the
mousedown touchstart
event to the cached image, so the user can drag it with one fluent movement?How can I speed up caching? (It takes 1-2 seconds for the cached image to appear. Is it useful to cache it in a
setInterval
after every, lets say 4 secs, and use this precached image or causes that a too high performance drain?)
I highly appreciate any kind of suggestions regarding my problem or further tips&tricks to speed up things.