text4u
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

static_caching.php 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. /*
  85. |--------------------------------------------------------------------------
  86. | Replacers
  87. |--------------------------------------------------------------------------
  88. |
  89. | Here you may define replacers that dynamically replace content within
  90. | the response. Each replacer must implement the Replacer interface.
  91. |
  92. */
  93. 'replacers' => [
  94. \Statamic\StaticCaching\Replacers\CsrfTokenReplacer::class,
  95. \Statamic\StaticCaching\Replacers\NoCacheReplacer::class,
  96. ],
  97. /*
  98. |--------------------------------------------------------------------------
  99. | Warm Queue
  100. |--------------------------------------------------------------------------
  101. |
  102. | Here you may define the name of the queue that requests will be pushed
  103. | onto when warming the static cache using the static:warm command.
  104. |
  105. */
  106. 'warm_queue' => null,
  107. ];