parabol/parabol-cache-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

parabol/parabol-cache-bundle

Composer 安装命令:

composer require parabol/parabol-cache-bundle

包简介

Automatic web cache system for symfony3 projects.

README 文档

README

#ParabolCacheBundle The ParabolCacheBundle provides view caching functionality for Symfony/Doctrine (for now only ORM) projects based on request/response events. All responses for GET-requests (expect actions defined as excluded in bundle config) are stored in separated and minified files in symfony cache directory. The bundle also creates mapping for Doctrine queries in order to automatically clear only those cached files that are related to changing entity.

Pros:

  • Very easy installation
  • Start working just after 3 simple installation steps
  • Automatically creates cache for all not excluded actions
  • Automatically creates mapping between actions and entities
  • Automatically clear cached files related to Doctrine Entity in postPersist/postUpdate events.
  • Minify HTML output - useful for getting Google PageSpeed Tools better results ;)

##How it works ...

Installation

###1) Install via Composer:

composer require parabol/parabol-cache-bundle 

###2) Enable bundle in app/AppKernel.php by adding in registerBundles():

new Parabol\CacheBundle\ParabolCacheBundle()

###3) Change default Doctrine EntityManager by adding to app/config/config.yml:

parameters:
	doctrine.orm.entity_manager.class: Parabol\CacheBundle\Doctrine\ORM\EntityManager

###Congratulation your HTML Cache System should be working now.

Configuration

###Default bundle configuration

parabol_cache:
	cache_dev: false
	minifier_command:
	minifier_command_params: -o :target :source --case-sensitive --collapse-boolean-attributes  --collapse-inline-tag-whitespace --collapse-whitespace --html5 --keep-closing-slash --remove-attribute-quotes --remove-comments --remove-empty-attributes --use-short-doctype --minify-css --minify-js
	exclude: []
	exclude_pattern: ^\/(_|assetic|admin)

###Enable html-minifier In symfony config.yml file put minifier_command parameter with path to html-minifier proceeded by path to node.js:

parabol_cache:
	minifier_command: /usr/local/bin/node /usr/local/bin/html-minifier

or for better project movability in parameters.yml

parameters:
	minifier_command: /usr/local/bin/node /usr/local/bin/html-minifier

You can modify minified output by change minifier_command_params but keep in mind that the value must include the keywords: :target and :source

###Other minifier

If you want to use an other minfier just put right path in minifier_command and proper command parameters in minifier_command_params.

###Excluding actions from caching To exclude some actions from caching put their names (Bundle:Controller:action) into exclude array

parabol_cache:
	exclude: [AppBundle:Default:index, AppBundle:Other:show]

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固