.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ==================== EXT: Easy Cache Tags ==================== :Author: Christopher :Created: 2010-12-18T19:57:23 :Changed: 2011-09-15T12:44:18 :Classification: lilio_cachetags :Description: The keywords help with categorizing and tagging of the manuals. You can combine two or more keywords and add additional keywords yourself. Please use at least one keyword from both lists. If your manual is NOT in english, see next tab "language" ---- forEditors (use this for editors / german "Redakteure") forAdmins (use this for Administrators) forDevelopers (use this for Developers) forBeginners (manuals covering TYPO3 basics) forIntermediates (manuals going into more depth) forAdvanced (covering the most advanced TYPO3 topics) see more: http://wiki.typo3.org/doc_template#tags ---- :Keywords: typoscript, cache, forAdmins, forIntermediates :Author: Mathias Bolt Lesniak, LiliO :Email: mathias@lilio.com :Language: en .. _img-1-img-2-EXT-Easy-Cache-Tags: |img-1| |img-2| EXT: Easy Cache Tags ==================================== Extension Key: lilio\_cachetags Language: en Version: 0.0.1 Keywords: typoscript, cache, forAdmins, forIntermediates Copyright 2006-2011, Mathias Bolt Lesniak, LiliO, < `mathias@lilio.com `_ > Sponsored by: `LiliO – www.lilio.com `_ This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.org .. _Table-of-Contents: Table of Contents ----------------- **`EXT: Easy Cache Tags 1 <#1.EXT:%20Easy%20Cache%20Tags|outline>`_** **`Introduction 3 <#1.1.Introduction|outline>`_** `What does it do? 3 <#1.1.1.What%20does%20it%20do_|outline>`_ `Why is it needed? 3 <#1.1.2.Why%20is%20it%20needed_|outline>`_ `Requirements 3 <#1.1.3.Requirements|outline>`_ `Supported extensions 3 <#1.1.4.Supported%20extensions|outline>`_ `Sponsoring 4 <#1.1.5.Sponsoring|outline>`_ **`Users manual 5 <#1.2.Users%20manual|outline>`_** `Adding Cache Tags 5 <#1.2.1.Adding%20Cache%20Tags|outline>`_ `Clearing Cache 5 <#1.2.2.Clearing%20Cache%20|outline>`_ **`Known problems 6 <#1.3.Known%20problems|outline>`_** **`To-Do list 7 <#1.4.To-Do%20list|outline>`_** **`Change Log 8 <#1.5.Change%20Log|outline>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ This extension introduces two new cObjects in TypoScript: *CACHETAGS* and *CLEARCACHETAGS* . These can be used to add tags to page caches, and then clear the cache for pages related to one or more cache tags. The simplest use of this extension involves only two lines of TypoScript! .. _Why-is-it-needed: Why is it needed? ^^^^^^^^^^^^^^^^^ Extensions like tt\_news generate different content on the same page, depending on the parameters in the URL. The somewhat cryptic *cHash* parameter is used to tell TYPO3 to cache a different version of the page for each unique combination of parameters. If you have 1000 news articles viewed on the same page, you'll have 1000 different cached versions of that page. When you edit an article, you'll have to clear the cache for all 1000 news articles. Cache Tags (a feature of the Caching Framework within TYPO3) enables you to connect custom tags to each cached instance of a page. For example, the cache tag for news article UID #261 could be “tt\_news\_261”. It is possible to ask the Caching Framework to clear cache for only those cached instances relating to that particular tag. The result is that you clear one single cache instance instead of 1000. You can also add multiple different cache tags to the same page. **Example:** Imagine you have a site with a lot of FE Users. The users can edit their profiles through a form. You use the users' information on many different pages and in many different ways (e.g. single profile view, a list of users belonging to a specific group, etc.). With Easy Cache Tags you can relate the tag fe\_user\_101 to each cache instance where FE User #101's information is rendered, and fe\_user\_203 to each cache instance where FE User #203 is rendered. When FE User 203 updates his profile, you can clear cache on each cache instance related to that specific user. No other cache instances are cleared, and you don't even need to think about which Page ID's to clear! .. _Requirements: Requirements ^^^^^^^^^^^^ This extension requires that you have the new Caching Framework enabled in TYPO3. In TYPO3 version 4.5 and below you must enable the caching framework in localconf.php. Here's how you do it: $TYPO3\_CONF\_VARS['SYS']['useCachingFramework'] = true; You can read more about the Caching Framework at `wiki.typo3.org/Caching\_framework `_ . .. _Supported-extensions: Supported extensions ^^^^^^^^^^^^^^^^^^^^ Easy Cache Tags can be integrated with other extensions. .. _Static-File-Cache-nc-staticfilecache: Static File Cache (nc\_staticfilecache) """"""""""""""""""""""""""""""""""""""" Static files will be removed according to related Cache Tags. .. _Sponsoring: Sponsoring ^^^^^^^^^^ It is possible to sponsor new features. Please make contact at `mathias@lilio.com `_ for more information. Implementation of sponsored features is of course prioritized. .. _Users-manual: Users manual ------------ .. _Adding-Cache-Tags: Adding Cache Tags ^^^^^^^^^^^^^^^^^ You can add any number of tags each time a page is rendered. Since everything you need to do is to insert a TypoScript cObject, you can even insert it into any stdWrap property (e.g. using the *prepend* or *append* properties of stdWrap). The CACHETAGS cObject is an array of tag names (e.g. “fe\_user”). Each tag name is a normal stdWrap. The result of the stdWrap becomes the tag's value, in the format \_. If the tag relates to a row uid of a specific table, we recommend that you use that table's name (e.g. “tx\_myextension\_records” as the tag name). .. _Example-1: Example 1 """"""""" This will create the tag “fe\_user\_X” (where X is the value of the someUserId parameter): :: page.20 = CACHETAGS page.20 { fe_user.data = GP:someUserUid } .. _Example-2: Example 2 """"""""" Within a stdWrap (creates the tag “tx\_someextension\_X”, where X is whatever UID field data the extension provides): :: plugin.tx_someextension_pi1.headerWrap { prepend = CACHETAGS prepend.tx_someextension.field = uid } .. _Clearing-Cache: Clearing Cache ^^^^^^^^^^^^^^ Clearing cache is just as simple as adding the cache tags. **Important:** The cache clearing needs to be done as non-cached content, placed within a COA\_INT or rendered by a non-caching extension or on a non-cahced page. .. _Example-1: Example 1 """"""""" This will clear the cache for the the tag “fe\_user\_X” (where X is the value of the someUserId parameter): :: page.20 = COA_INT page.20.1 = CLEARCACHETAGS page.20.1 { fe_user.data = GP:someUserUid } .. _Example-2: Example 2 """"""""" Within a stdWrap (creates the tag “tx\_someextension\_X”, where X is whatever UID field data the extension provides). The clearing occurs only when the GET/POST parameter “submitted” is true (e.g. if a form is submitted, which changes data): :: [globalVar: GP:submitted > 0] plugin.tx_someextension_pi1.headerWrap { prepend = CLEARCACHETAGS prepend.tx_someextension.field = uid } [global] .. _Known-problems: Known problems -------------- None known. Please report any issues to `mathias@lilio.com `_ . .. _To-Do-list: To-Do list ---------- - Possibility to add and clear cache based on Cache Tags in Backend. - Built-in support for more caching extensions. .. _Change-Log: Change Log ---------- .. ### BEGIN~OF~TABLE ### .. _0-0-1: 0.0.1 ^^^^^ .. container:: table-row Version 0.0.1 Changes First upload. .. ###### END~OF~TABLE ###### .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 44 .. :id: graphics5 .. :name: graphics5 .. :vspace: 57 .. :width: 161 .. |img-2| image:: img-2.png .. :align: left