Cache.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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> THREE.Cache.enabled = true. </code>
  17. <h2>Examples</h2>
  18. <p>
  19. [example:webgl_geometry_text WebGL / geometry / text ]<br />
  20. [example:webgl_interactive_instances_gpu WebGL / interactive / instances / gpu]<br />
  21. [example:webgl_loader_ttf WebGL / loader / ttf]
  22. </p>
  23. <h2>Properties</h2>
  24. <h3>[property:Boolean enabled]</h3>
  25. <p>Whether caching is enabled. Default is `false`.</p>
  26. <h3>[property:Object files]</h3>
  27. <p>An [page:Object object] that holds cached files.</p>
  28. <h2>Methods</h2>
  29. <h3>[method:undefined add]( [param:String key], [param:Object file] )</h3>
  30. <p>
  31. [page:String key] — the [page:String key] to reference the cached file
  32. by.<br />
  33. [page:Object file] — The file to be cached.<br /><br />
  34. Adds a cache entry with a key to reference the file. If this key already
  35. holds a file, it is overwritten.
  36. </p>
  37. <h3>[method:Any get]( [param:String key] )</h3>
  38. <p>
  39. [page:String key] — A string key <br /><br />
  40. Get the value of [page:String key]. If the key does not exist `undefined`
  41. is returned.
  42. </p>
  43. <h3>[method:undefined 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:undefined 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>