Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

static_caching.php 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Active Static Caching Strategy
  6. |--------------------------------------------------------------------------
  7. |
  8. | To enable Static Caching, you should choose a strategy from the ones
  9. | you have defined below. Leave this null to disable static caching.
  10. |
  11. */
  12. 'strategy' => env('STATAMIC_STATIC_CACHING_STRATEGY', null),
  13. /*
  14. |--------------------------------------------------------------------------
  15. | Caching Strategies
  16. |--------------------------------------------------------------------------
  17. |
  18. | Here you may define all of the static caching strategies for your
  19. | application as well as their drivers.
  20. |
  21. | Supported drivers: "application", "file"
  22. |
  23. */
  24. 'strategies' => [
  25. 'half' => [
  26. 'driver' => 'application',
  27. 'expiry' => null,
  28. ],
  29. 'full' => [
  30. 'driver' => 'file',
  31. 'path' => public_path('static'),
  32. 'lock_hold_length' => 0,
  33. 'permissions' => [
  34. 'directory' => 0755,
  35. 'file' => 0644,
  36. ],
  37. ],
  38. ],
  39. /*
  40. |--------------------------------------------------------------------------
  41. | Exclusions
  42. |--------------------------------------------------------------------------
  43. |
  44. | Here you may define a list of URLs to be excluded from static
  45. | caching. You may want to exclude URLs containing dynamic
  46. | elements like contact forms, or shopping carts.
  47. |
  48. */
  49. 'exclude' => [
  50. 'class' => null,
  51. 'urls' => [
  52. //
  53. ],
  54. ],
  55. /*
  56. |--------------------------------------------------------------------------
  57. | Invalidation Rules
  58. |--------------------------------------------------------------------------
  59. |
  60. | Here you may define the rules that trigger when and how content would be
  61. | flushed from the static cache. See the documentation for more details.
  62. | If a custom class is not defined, the default invalidator is used.
  63. |
  64. | https://statamic.dev/static-caching
  65. |
  66. */
  67. 'invalidation' => [
  68. 'class' => null,
  69. 'rules' => [
  70. //
  71. ],
  72. ],
  73. /*
  74. |--------------------------------------------------------------------------
  75. | Ignoring Query Strings
  76. |--------------------------------------------------------------------------
  77. |
  78. | Statamic will cache pages of the same URL but with different query
  79. | parameters separately. This is useful for pages with pagination.
  80. | If you'd like to ignore the query strings, you may do so.
  81. |
  82. */
  83. 'ignore_query_strings' => false,
  84. 'allowed_query_strings' => [
  85. //
  86. ],
  87. 'disallowed_query_strings' => [
  88. //
  89. ],
  90. /*
  91. |--------------------------------------------------------------------------
  92. | Nocache
  93. |--------------------------------------------------------------------------
  94. |
  95. | Here you may define where the nocache data is stored.
  96. |
  97. | https://statamic.dev/tags/nocache#database
  98. |
  99. | Supported drivers: "cache", "database"
  100. |
  101. */
  102. 'nocache' => 'cache',
  103. 'nocache_js_position' => 'body',
  104. /*
  105. |--------------------------------------------------------------------------
  106. | Replacers
  107. |--------------------------------------------------------------------------
  108. |
  109. | Here you may define replacers that dynamically replace content within
  110. | the response. Each replacer must implement the Replacer interface.
  111. |
  112. */
  113. 'replacers' => [
  114. \Statamic\StaticCaching\Replacers\CsrfTokenReplacer::class,
  115. \Statamic\StaticCaching\Replacers\NoCacheReplacer::class,
  116. ],
  117. /*
  118. |--------------------------------------------------------------------------
  119. | Warm Queue
  120. |--------------------------------------------------------------------------
  121. |
  122. | Here you may define the queue name and connection
  123. | that will be used when warming the static cache.
  124. |
  125. */
  126. 'warm_queue' => env('STATAMIC_STATIC_WARM_QUEUE'),
  127. 'warm_queue_connection' => env('STATAMIC_STATIC_WARM_QUEUE_CONNECTION'),
  128. /*
  129. |--------------------------------------------------------------------------
  130. | Shared Error Pages
  131. |--------------------------------------------------------------------------
  132. |
  133. | You may choose to share the same statically generated error page across
  134. | all errors. For example, the first time a 404 is encountered it will
  135. | be generated and cached, and then served for all subsequent 404s.
  136. |
  137. | This is only supported for half measure.
  138. |
  139. */
  140. 'share_errors' => false,
  141. ];