Cache.php 2.8 KB

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