Cache.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. A simple caching system, used internally by [page:FileLoader].
  14. </p>
  15. <h2>Examples</h2>
  16. <p>
  17. [example:webgl_geometry_text WebGL / geometry / text ]<br />
  18. [example:webgl_interactive_instances_gpu WebGL / interactive / instances / gpu]<br />
  19. [example:webgl_loader_ttf WebGL / loader / ttf]
  20. </p>
  21. <h2>Usage</h2>
  22. <p>To enable caching across all loaders that use [page:FileLoader], set</p>
  23. <code>
  24. THREE.Cache.enabled = true.
  25. </code>
  26. <h2>Properties</h2>
  27. <h3>[property:Boolean enabled]</h3>
  28. <p>Whether caching is enabled. Default is *false*.</p>
  29. <h3>[property:Object files]</h3>
  30. <p>An [page:Object object] that holds cached files.</p>
  31. <h2>Methods</h2>
  32. <h3>[method:null add]( [param:String key], file )</h3>
  33. <p>
  34. [page:String key] — the [page:String key] to reference the cached file by.<br />
  35. [page:Object file] — The file to be cached.<br /><br />
  36. Adds a cache entry with a key to reference the file. If this key already holds a file,
  37. it is overwritten.
  38. </p>
  39. <h3>[method:null get]( [param:String key] )</h3>
  40. <p>
  41. [page:String key] — A string key <br /><br />
  42. Get the value of [page:String key]. If the key does not exist *undefined* is returned.
  43. </p>
  44. <h3>[method:null remove]( [param:String key] )</h3>
  45. <p>
  46. [page:String key] — A string key that references a cached file.<br /><br />
  47. Remove the cached file associated with the key.
  48. </p>
  49. <h3>[method:null clear]()</h3>
  50. <p>Remove all values from the cache.</p>
  51. <h2>Source</h2>
  52. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  53. </body>
  54. </html>