Cache.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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.</p>
  28. <p>Default is <code>false</code>.</p>
  29. </div>
  30. </div>
  31. <div class="member">
  32. <h3 class="name" id=".files" translate="no">.<a href="#.files">files</a><span class="type-signature"> : Object.&lt;string, Object></span> </h3>
  33. <div class="description">
  34. <p>A dictionary that holds cached files.</p>
  35. </div>
  36. </div>
  37. <h2 class="subsection-title">Static Methods</h2>
  38. <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>
  39. <div class="method">
  40. <div class="description">
  41. <p>Adds a cache entry with a key to reference the file. If this key already
  42. holds a file, it is overwritten.</p>
  43. </div>
  44. <table class="params">
  45. <tbody>
  46. <tr>
  47. <td class="name">
  48. <strong>key</strong>
  49. </td>
  50. <td class="description last">
  51. <p>The key to reference the cached file.</p>
  52. </td>
  53. </tr>
  54. <tr>
  55. <td class="name">
  56. <strong>file</strong>
  57. </td>
  58. <td class="description last">
  59. <p>The file to be cached.</p>
  60. </td>
  61. </tr>
  62. </tbody>
  63. </table>
  64. </div>
  65. <h3 class="name name-method" id=".clear" translate="no">.<a href="#.clear">clear</a><span class="signature">()</span> </h3>
  66. <div class="method">
  67. <div class="description">
  68. <p>Remove all values from the cache.</p>
  69. </div>
  70. </div>
  71. <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>
  72. <div class="method">
  73. <div class="description">
  74. <p>Gets the cached value for the given key.</p>
  75. </div>
  76. <table class="params">
  77. <tbody>
  78. <tr>
  79. <td class="name">
  80. <strong>key</strong>
  81. </td>
  82. <td class="description last">
  83. <p>The key to reference the cached file.</p>
  84. </td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. <dl class="details">
  89. <dt class="tag-returns"><strong>Returns:</strong> The cached file. If the key does not exist <code>undefined</code> is returned.</dt>
  90. </dl>
  91. </div>
  92. <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>
  93. <div class="method">
  94. <div class="description">
  95. <p>Removes the cached file associated with the given key.</p>
  96. </div>
  97. <table class="params">
  98. <tbody>
  99. <tr>
  100. <td class="name">
  101. <strong>key</strong>
  102. </td>
  103. <td class="description last">
  104. <p>The key to reference the cached file.</p>
  105. </td>
  106. </tr>
  107. </tbody>
  108. </table>
  109. </div>
  110. <h2 class="subsection-title">Source</h2>
  111. <p>
  112. <a href="https://github.com/mrdoob/three.js/blob/master/src/loaders/Cache.js" translate="no" target="_blank" rel="noopener">src/loaders/Cache.js</a>
  113. </p>
  114. </article>
  115. </section>
  116. <script src="../scripts/linenumber.js"></script>
  117. <script src="../scripts/page.js"></script>
  118. </body>
  119. </html>
粤ICP备19079148号