sunnysideup/simple-template-caching

Basic functions for caching content in your SS templates.

4.0.2 2021-04-01 10:38 UTC

This package is auto-updated.

Last update: 2022-09-20 09:59:54 UTC


README

Basic Caching Functionality For Page Templates

install

composer require sunnysideup/simple-template-caching

usage

<!doctype html>
<html lang="$ContentLocale">
<head>
    <title>example</title>
</head>
<body>

    <% if $HasCacheKeyHeader %>
    <% cached $CacheKeyHeader %>
        <!-- cached header -->
        <% include Header %>
    <% end_cached %>
    <% else %>
        <% include Header %>
    <% end_if %>

    <% if $HasCacheKeyMenu %>
        <% cached $CacheKeyMenu %>
            <!-- cached menu -->
            <% include Menu %>
        <% end_cached %>
    <% else %>
        <% include Menu %>
    <% end_if %>
        
    <% if $HasCacheKeyContent %>
        <% cached $CacheKeyContent %>
            <!-- cached content -->
            $Layout
        <% end_cached %>
    <% else %>
        $Layout
    <% end_if %>

    <% if $HasCacheKeyFooter %>
    <% cached $CacheKeyFooter %>
        <!-- cached footer -->
        <% include Footer %>
    <% end_cached %>
    <% else %>
        <% include Footer %>
    <% end_if %>

</body>
</html>