Rah memcached - Store parts of Textpattern CMS templates in Memcached

Overview

rah_memcached

Packagist | Issues | Donate

A plugin for Textpattern CMS that stores parts of your templates in Memcached, a distributed in-memory key-value caching system.

Install

Using Composer:

$ composer require rah/rah_memcached

Basics

The plugin, rah_memcached, introduces a new container tag to Textpattern’s arsenal. The tag stores the wrapped content, and variables set within it, in Memcached’s in-memory storage.

<rah::memcached>
    <txp:variable name="variable1" value="value" />
    <txp:article_custom limit="200">
        <txp:title />
    </txp:article_custom>
</rah::memcached>

On subsequent calls the resulting output markup and variables will be loaded from memory, skipping template parsing and code execution, speeding up your site and alleviating database load.

Requirements

Install external dependencies

To use the plugin you must first install Memcached, libmemcached and the PHP Memcached extension.

On Ubuntu and Debian

Using apt:

$ apt install memcached php5-memcached

On Mac OS

Using Homebrew and pecl:

$ brew install pkg-config php libmemcached memcached
$ pecl install memcached

Configuration

Connected server can be configured through Textpattern’s config.php:

define('\RAH_MEMCACHED_HOST', 'localhost');
define('\RAH_MEMCACHED_PORT', 11211);

Attributes

<rah::memcached>
    ...contained statement...
</rah::memcached>

The tag is a container and attributes for it follow.

expires
Time in seconds it takes to the stored item to expire and be refreshed. If zero (0), the cache is kept in memory until the cache is flushed or Memcached is restarted.
Default: 0 Example: expires="3600"

persist
If enabled, ignores content updates as set by site’s lastmod timestamp.
Default: disabled Example: persist

name
Sets a name, a key, for the cached item. The given name used identify the item and fetch it from the storage. If a name is not defined, its automatically created by hashing the given contained markup. While the name is option, giving it is more efficient and avoids any potential collisions.
Default: undefined Example: name="mykey"

Examples

Store section navigation in memory

<rah::memcached name="navigation">
    <txp:section_list wraptag="ul" break="li">
        <txp:section />
    </txp:section_list>
</rah::memcached>

Store variables in memory

<rah::memcached>
    <txp:variable name="color" value="red" />
    <txp:variable name="size" value="small" />
</rah::memcached>

Color: <txp:variable name="color" />
Size: <txp:variable name="size" />

Changelog

Version 0.2.0 – upcoming

  • Register the tag.
  • Replaced lastmod attribute with persist.
  • Now requires Textpattern 4.7.0 or newer.

Version 0.1.0 – 2014/03/19

  • Initial release.
You might also like...
Magento 2 Italian Language Pack is special gift for Magento 2 Community Edition. The data of the translation is supplied by Magento 2 Translation Project of Crowdin site, on which you will contribute into the project and download the zip file to install on your own store. This knowledge base will include full of the clear guides that supports you to convert the default language (English) into Italian language on your entire store.
MassPlugCompiler - Textpattern CMS plugin compiler

mtxpc mtxpc compiles Textpattern CMS plugin sources into installer packages. Supports multi-file structure and a JSON manifest file. Install Using Com

Ied plugin composer - Inspired Plugin Composer: Create, publish and edit plugins from within Textpattern CMS.

ied_plugin_composer Create, publish and edit plugins from within Textpattern CMS. Creates a new page under the Extensions tab where you can edit and e

Etc cache - Cache plugin for Textpattern CMS

etc_cache Download | Packagist This Textpattern plugin provides an events-driven cache solution for Textpattern CMS. Textpattern is fast, but when you

Etc pagination - Pagination plugin for Textpattern CMS.

etc_pagination Download | Packagist This Textpattern plugin creates a paginated navigation bar on listings. It has a wide variety of attributes – so y

Smd imagery - A Textpattern CMS plugin for managing images in the Write panel.

smd_imagery Insert images into your Write panel. Very handy for people who run photoblog or image-heavy sites, or those who categorise images for incl

Zem contact reborn - An extensible HTML form mailer plugin for Textpattern CMS.

com_connect Contents Introduction Installing and upgrading Migrating from zem_contact_reborn Usage Tags com_connect tag com_connect_text tag com_conne

Oui player - Manage configurable media players in @Textpattern CMS

oui_player Introduction An extendable plugin to easily embed customized audio and video players. . This plugin does not use oembed, it builds iframe e

Smd tags - A Textpattern CMS plugin for unlimited, structured taxonomy across content types.

smd_tags Tag articles, images, files and links with stuff, then use the public-side tags to display the lists, filter or find related content. Feature

Comments
  • questions about rah_memcached

    questions about rah_memcached

    (Yeah, I know, the subject for this issue sucks!)

    Hi, gocom. I've just found this new rah thing. Looks nice! I've yet to install it and give it a try. In the meanwhile, I've a few questions:

    1. Does this plugin provide a similar functionality to aks_cache? It seems so, but I've to ask.

    2. I see the plugin provides some cache flushing mechanism on content updates. Does it also provide any mechanism (a GUI?) to flush the cache "manually"?

    3. Tangentially related: what about rah_cache? Is it still under ongoing development (seems not) or should I forget about it? (I've installed it on a project but never found the time to configure and test it properly).

    Thank you.

    opened by maniqui 1
Releases(0.3.0)
Owner
Jukka Svahn
Backend developer by trade, hobbyist designer and frontend fiddler, self-proclaimed home cook and baker
Jukka Svahn
Rah backup - Takes backups from Textpattern CMS installations

rah_backup Packagist | Twitter | Donate Rah_backup keeps your important site safe from disastrous events. Rah_backup is an admin-side backup utility p

Jukka Svahn 5 Apr 24, 2022
Rah sitemap - XML sitemap generator for Textpattern CMS

rah_sitemap Packagist | Issues | Donate Sitemap plugin for Textpattern CMS. Generates Sitemaps.org XML sitemaps for your site, which help Google and o

Jukka Svahn 7 May 13, 2022
Rah comment spam - Comment anti-spam plugin for Textpattern CMS

rah_comment_spam Packagist | Issues | Donate Rah_comment_spam provides customizable anti-spam tools for Textpattern CMS’ comment system. Set minimum a

Jukka Svahn 2 Apr 24, 2022
Rah comments - Paginated article comments list for Textpattern CMS

rah_comments Download | Packagist | Issues | Support forum | Donate Rah_comments lets you to paginate Textpattern CMS’ comment lists, splitting the lo

Jukka Svahn 1 Mar 23, 2015
Rah privileges - Configure Textpattern CMS' user-group privileges through Preferences panel

rah_privileges Packagist | Donate Configure admin-side user-group permissions from Textpattern CMS’ preferences panel. Install Using Composer: $ compo

Jukka Svahn 4 Apr 16, 2022
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Friends Of REDAXO 17 Sep 12, 2022
Rah cache - Cache Textpattern's dynamic pages as flat files

rah_cache Packagist | Issues Rah_cache is a simple, experimental full-page caching plugin for Textpattern CMS. It caches Texpattern’s dynamic pages as

Jukka Svahn 2 Apr 24, 2022
Textpattern-for-Panic-Coda - A Textpattern CMS mode for Panic Coda

Textpattern elements for Panic Coda 2 Handy elements for use with Panic Coda 2 on a Mac when authoring files for the Textpattern CMS. This repository

Phil Wareham 8 Jun 26, 2017
Textpattern-installer - Textpattern plugin and theme installer for Composer

Textpattern Installer for Composer Package directory | Issues Install plugins and themes to Textpattern CMS with Composer. $ composer require rah/rah_

Jukka Svahn 7 Apr 14, 2022
Get mobile app version and other related data from Google Play Store, Apple App Store and Huawei AppGallery

Mobile App Version Get mobile app version and other related data from Google Play Store, Apple App Store and Huawei AppGallery. Installation Add to co

Omer Salaj 11 Mar 15, 2022