Cache.html 1.9 KB

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