Cache.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * FecShop file.
  4. * @link http://www.fecshop.com/
  5. * @copyright Copyright (c) 2016 FecShop Software LLC
  6. * @license http://www.fecshop.com/license/
  7. */
  8. return [
  9. 'cache' => [
  10. 'class' => 'fecshop\services\Cache',
  11. /*
  12. * cache 总开关,设置false后,无论cacheConfig中的enable
  13. * 是否为true,都会全部关闭掉cache。
  14. */
  15. 'enable'=> false,
  16. /*
  17. * 各个页面cache的配置
  18. */
  19. 'cacheConfig' => [
  20. // 分类页面
  21. 'category' => [
  22. 'enable' => true, // 是否开启分类页面的缓存
  23. 'timeout' => 3600, // 则设置缓存的过期时间,这里设置为秒
  24. 'disableUrlParam' => 'fecshop', // 如果开启缓存,在url加入什么参数后,系统不读取缓存,这个选项是为了方便在不刷新缓存的情况下,查看无缓存的页面是什么样子。
  25. // url出现的这些参数的值,将参与cache唯一key的生成。
  26. 'cacheUrlParam' => [],
  27. ],
  28. // 产品页面
  29. 'product' => [
  30. 'enable' => true, // 是否开启产品页面的缓存
  31. 'timeout' => 3600, //则设置缓存的过期时间,这里设置为秒
  32. 'disableUrlParam' => 'fecshop', // 如果开启缓存,在url加入什么参数后,系统不读取缓存,这个选项是为了方便在不刷新缓存的情况下,查看无缓存的页面是什么样子。
  33. ],
  34. // 首页页面
  35. 'home' => [
  36. 'enable' => true, // 是否开启首页页面的缓存
  37. 'timeout' => 3600, // 则设置缓存的过期时间,这里设置为秒
  38. 'disableUrlParam' => 'fecshop', // 如果开启缓存,在url加入什么参数后,系统不读取缓存,这个选项是为了方便在不刷新缓存的情况下,查看无缓存的页面是什么样子。
  39. ],
  40. // Article(page)页面
  41. 'article' => [
  42. 'enable' => true, // 是否开启Article页面的缓存
  43. 'timeout' => 3600, // 则设置缓存的过期时间,这里设置为秒
  44. 'disableUrlParam' => 'fecshop', // 如果开启缓存,在url加入什么参数后,系统不读取缓存,这个选项是为了方便在不刷新缓存的情况下,查看无缓存的页面是什么样子。
  45. ],
  46. ],
  47. ],
  48. ];