Como configurar o eZ Publish 5.x em modo de desenvolvimento ( Sem cache ) ?

por Pedro Resende em 26/12/2013 às 07:30:00

Este tutorial serve para explicar como se devem colocar as configurações de modo a que seja possível utilizar o eZ Publish 5.x em modo de desenvolvimento, ou seja sem cache.
As seguintes configurações permitem que sejam feitas alterações, tanto a nível de templates twig bem como a nível de conteúdo.

Começem por abrir o ficheiro

$ vi ezpublish/config/config.yml

Na secção do twig, adicionem cache: false, de modo a que fique com o seguinte aspecto

twig:
    cache: false
    ```

Abram agora o ficheiro

```bash
$ vi ezpublish/config/ezpublish.yml

Na secção do vosso siteaccess (por defeito eng), deverão adicionar

content:
    view_cache: false      # Activates HttpCache for content
    ttl_cache: false       # Activates expiration based HttpCache for content (very fast)
    default_ttl: 0       # Number of seconds an Http response is valid in cache (if ttl_cache is true)

Deverá ficar com o seguinte aspecto

ezpublish:
    system:
        my_siteaccess:
            content:
                view_cache: false      # Activates HttpCache for content
                ttl_cache: false       # Activates expiration based HttpCache for content (very fast)
                default_ttl: 0       # Number of seconds an Http response is valid in cache (if ttl_cache is true)

Por fim, deverão limpar a cache para que as novas configurações entrem em "vigor"

$ php ezpublish/console cache:clear --env=prod

No caso de já estarem no ambiente de dev, deverão correr

$ php ezpublish/console cache:clear --env=dev
Pedro Resende

Pedro Resende

With over two decades of experience as a Full Stack Developer, I have journeyed through diverse facets of software development. Commencing with the creation of compact institutional websites, I progressed to crafting portals for insurance brokers and contributed to substantial projects for renowned companies such as MS Amlin. My expertise expanded further by delving into product development for Advertiser Kwanko and collaborating with startups in their pivotal ramp-up stages. Notably, I've been involved in architecting extensive e-commerce solutions for global enterprises like Wayfair.

I currently serve as the Tech Lead at Emergn, contributing to the establishment and advancement of the Strategyzer client.