does Away3D cache assets?

Software: Away3D 4.x

Avatar
Choons, Sr. Member
Posted: 05 September 2011 12:44 AM   Total Posts: 281

Hi guys,

I’m curious if or to what extent 3D content gets cached in the Away3D + Flash environment? Like if I have a browser-based game, do I get any significant bandwidth savings on my server via caching if the user leaves the site and comes back say the next day or a week later?

   

Richard Olsson, Administrator
Posted: 05 September 2011 05:31 AM   Total Posts: 1192   [ # 1 ]

Away3D doesn’t do any caching between sessions, because the Flash Player security model would never let it. SharedObject is the only way to store data locally between sessions at all, and the size restrictions prevent it from being useful for asset caching.

More importantly though, consider the Flash Player networking model. Away3D will rely on Flash Player to load resources (instead of implementing an embedded HTML client), and similarly Flash Player will rely on the browser to load them, so that when you initiate a load, it’s actually the browser that carries it out. Thanks to this, you automatically get all the benefits of the browser’s cache, allowing you to not have to think about these things (except when you need to prevent caching.)

   

Avatar
Choons, Sr. Member
Posted: 05 September 2011 05:55 AM   Total Posts: 281   [ # 2 ]

Thanks for the cogent reply, Richard. It would be interesting to monitor to what extent that whole chain down to the browser actually does cache inter-session assets

   

Richard Olsson, Administrator
Posted: 05 September 2011 06:08 AM   Total Posts: 1192   [ # 3 ]

It will, provided that the URL is a simple path (no query string), that the exact same URL has been loaded before, and that the server is configured to allow caching.

The way browser caching works is that the first time that a browser queries a server for a resource, the server will send along a header with a unique string for that file. It can be a checksum or a timestamp or virtually anything. The next time the browser requests that resource, it will send back the string it received last time, effectively asking the server “has the file changed since you gave me this token?”. The server will reply with a 304 Not modified HTTP response.

Provided that your server is correctly configured to allow this, and the user has not disabled browser caching, it will just work.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X