Skip to content

Instantly share code, notes, and snippets.

@DavidOliver
DavidOliver / symphony-cms-caching-extensions.md
Created November 3, 2012 19:45 — forked from anonymous/gist:4008089
A guide to caching extensions (Symphony CMS) by Nick Dunn

There are many types of caching that will improve website performance. Here are just five:

MySQL query caching

Every read query that Symphony executes is cached by MySQL. It is important to understand that this is not the result of the query, but the SQL statement itself. MySQL retains a pool of these statements so that they are quicker to execute in the future. This is pretty standard, and you can use it in your own applications too by using SELECT SQL_CACHE for your read queries.

Object caching

Once the database has been queried, the results are used to build objects (pages, data sources, sections, field, entries etc.). These objects are alive only for the lifespan of each page, and are destroyed at the end of each request. Systems such as Wordpress allow these objects to be cached and persisted between each page request (using APC, Memcache, flat files or MySQL), thereby shared between all users. Symphony doesn't do this, but it really should.

Fragment caching

If you have one piece of a p

<?xml version="1.0" encoding="utf-8" ?>
<data>
<corsi-per-tutti>
<section id="7" handle="corsi-per-tutti">Corsi per tutti</section>
<entry id="69">
<titolo handle="corsi-intensivi-di-lingua">Corsi intensivi di lingua</titolo>
</entry>
<entry id="67">
<titolo handle="prezzi">Prezzi</titolo>
</entry>