2017 © Pedro Peláez
 

symfony-bundle parabol-cache-bundle

Automatic web cache system for symfony3 projects.

image

parabol/parabol-cache-bundle

Automatic web cache system for symfony3 projects.

  • Monday, July 3, 2017
  • by parabolalab
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

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., (*1)

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 ;), (*2)

How it works

..., (*3)

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:, (*4)

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

or for better project movability in parameters.yml, (*5)

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, (*6)

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., (*7)

Excluding actions from caching

To exclude some actions from caching put their names (Bundle:Controller:action) into exclude array, (*8)

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

The Versions

03/07 2017

dev-master

9999999-dev https://github.com/parabolalab/ParabolCacheBundle

Automatic web cache system for symfony3 projects.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

cache caching html minifier html minify cache system caching system html minimize

01/02 2017

1.0.2

1.0.2.0 https://github.com/parabolalab/ParabolCacheBundle

Automatic web cache system for symfony3 projects.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

cache caching html minifier html minify cache system caching system html minimize

03/11 2016

1.0.1

1.0.1.0 https://github.com/parabolalab/ParabolCacheBundle

Automatic web cache system for symfony3 projects.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

cache caching html minifier html minify cache system caching system html minimize

02/11 2016

1.0

1.0.0.0 https://github.com/parabolalab/ParabolCacheBundle

Automatic web cache system for symfony3 projects.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

cache caching html minifier html minify cache system caching system html minimize