Cache.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Cache - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <h1 translate="no">Cache</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>A simple caching system, used internally by <a href="FileLoader.html">FileLoader</a>.
  16. To enable caching across all loaders that use <a href="FileLoader.html">FileLoader</a>, add <code>THREE.Cache.enabled = true.</code> once in your app.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <div class="method">
  21. </div>
  22. </div>
  23. <h2 class="subsection-title">Properties</h2>
  24. <div class="member">
  25. <h3 class="name" id=".enabled" translate="no">.<a href="#.enabled">enabled</a><span class="type-signature"> : boolean</span> </h3>
  26. <div class="description">
  27. <p>Whether caching is enabled or not.<br/>Default is <code>false</code>.</p>
  28. </div>
  29. </div>
  30. <div class="member">
  31. <h3 class="name" id=".files" translate="no">.<a href="#.files">files</a><span class="type-signature"> : Object.&lt;string, Object></span> </h3>
  32. <div class="description">
  33. <p>A dictionary that holds cached files.</p>
  34. </div>
  35. </div>
  36. <h2 class="subsection-title">Static Methods</h2>
  37. <h3 class="name name-method" id=".add" translate="no">.<a href="#.add">add</a><span class="signature">( key : <span class="param-type">string</span>, file : <span class="param-type">Object</span> )</span> </h3>
  38. <div class="method">
  39. <div class="description">
  40. <p>Adds a cache entry with a key to reference the file. If this key already
  41. holds a file, it is overwritten.</p>
  42. </div>
  43. <table class="params">
  44. <tbody>
  45. <tr>
  46. <td class="name"><code>key</code></td>
  47. <td class="description last"><p>The key to reference the cached file.</p></td>
  48. </tr>
  49. <tr>
  50. <td class="name"><code>file</code></td>
  51. <td class="description last"><p>The file to be cached.</p></td>
  52. </tr>
  53. </tbody>
  54. </table>
  55. </div>
  56. <h3 class="name name-method" id=".clear" translate="no">.<a href="#.clear">clear</a><span class="signature">()</span> </h3>
  57. <div class="method">
  58. <div class="description">
  59. <p>Remove all values from the cache.</p>
  60. </div>
  61. </div>
  62. <h3 class="name name-method" id=".get" translate="no">.<a href="#.get">get</a><span class="signature">( key : <span class="param-type">string</span> )</span><span class="type-signature"> : Object | undefined</span> </h3>
  63. <div class="method">
  64. <div class="description">
  65. <p>Gets the cached value for the given key.</p>
  66. </div>
  67. <table class="params">
  68. <tbody>
  69. <tr>
  70. <td class="name"><code>key</code></td>
  71. <td class="description last"><p>The key to reference the cached file.</p></td>
  72. </tr>
  73. </tbody>
  74. </table>
  75. <dl class="details">
  76. <dt class="tag-returns"><strong>Returns:</strong> The cached file. If the key does not exist <code>undefined</code> is returned.</dt>
  77. </dl>
  78. </div>
  79. <h3 class="name name-method" id=".remove" translate="no">.<a href="#.remove">remove</a><span class="signature">( key : <span class="param-type">string</span> )</span> </h3>
  80. <div class="method">
  81. <div class="description">
  82. <p>Removes the cached file associated with the given key.</p>
  83. </div>
  84. <table class="params">
  85. <tbody>
  86. <tr>
  87. <td class="name"><code>key</code></td>
  88. <td class="description last"><p>The key to reference the cached file.</p></td>
  89. </tr>
  90. </tbody>
  91. </table>
  92. </div>
  93. <h2 class="subsection-title">Source</h2>
  94. <p>
  95. <a href="https://github.com/mrdoob/three.js/blob/master/src/loaders/Cache.js" target="_blank" rel="noopener" translate="no">src/loaders/Cache.js</a>
  96. </p>
  97. </article>
  98. </section>
  99. <script src="../scripts/linenumber.js"></script>
  100. <script src="../scripts/page.js"></script>
  101. </body>
  102. </html>
粤ICP备19079148号