Smarty Cache for Thelia

A simple module to cache some parts of a template. It uses a smarty function.

Usage

The example will cache the generate code of a navigation menu. It will generate different caches depending of the current category, the lang and the currency. The cache will be used for 60 seconds, before being deleted :

{tcache key="navigation" ttl="60" category={category attr="id"}}
    <div class="navigation">
        {loop name="category-navigation" type="category" }
            ....
            <!-- other expensive loop -->
            ....
        {/loop}
    </div>
{/tcache}

Parameters

  • key : (mandatory) a unique key
  • ttl : (mandatory) a time to live in seconds
  • lang : specific cache by lang, possible values : on, off (default: on)
  • currency : specific cache by currency, possible values : on, off (default: on)
  • customer : specific cache by customer, possible values : on, off (default: off)
  • admin : specific cache by administator, possible values : on, off (default: off)
  • role : specific cache by role (none, customer, admin), possible values : on, off (default: off)

You can add as many arguments as you need. These arguments will be used to generate a unique key.

Download
Download

Smarty Cache for Thelia

A simple module to cache some parts of a template. It uses a smarty function.

Compatibility :

Thelia 2.1

Compatibility :

Thelia 2.2

Compatibility :

Thelia 2.3

Author :

Say Hi & Get in Touch

info@thelia.net - +33(0)4 44 05 31 00

Thelia Network English
E-commerce solution

E-commerce software, useful to create and manage online stores, published under a free license. Discover our new version, based on many modern technologies !

Download Thelia
Business

A team of experts at your service.

Showcase

Over 7000 online stores powered by Thelia

Modules

Customize your Thelia.

Openstudio

Thelia editor