BzZzZ - ustvarjamo podobe logo
slovenščina
english
Joomla 1.6 caching demystified (Jennifer series)

Tried to make this so easy than every Jennifer/Joe could understand it. ..Probably that's impossible - but the rest of you should be fine.

 

Joomla 1.6.  makes heavy use of caching and to be able to use it's full potential we must first understand how caching works. As caching was almost completely redone for  1.6. (mostly by the author of this article), some older descriptions and typologies don't apply any more.

 

Cache - temporary store an unit of information to be reused later.

Why?

Mostly because retrieving stored information is MUCH (up to 10 times or more) faster than initial generation. If you need a drastic example - a book is long term cache of it's authors knowledge. It could take years to accumulate this knowledge, while reading from this cache is a much faster thing as we all know.

But back to Joomla - more specifically, what we are dealing with here is web application caching - creating temporary static copies of otherwise dynamic pages (or smaller data units). Caching is particularly appropriate for web applications  as typical web site displays  the same content over and over again and without cache everything has to be generated for each and every page view. Caching system temporary stores this information generated by the code in a cache object and serves it when it is requested by the next user.

 

To understand Joomla cache a little deeper we must get familiar with two concepts - cache types and cache handlers.For easier understanding take a look at pictures that illustrate each cache type coverage area.

Beri dalje...
 
Magic words for sites using a lot of css / javascript

Ad this to .htaccess (requires mod_deflate)

<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

 

Beri dalje...
 
Disable statistics collection in Joomla - less backups, faster response

In Joomla 1.0 (or Mambo before that) one could simply disable statistics collection by choosing equaly named option in global configuration - guess what, this is not possible in 1.5. and it looks like it also won't be possible in 1.6.

While article view and weblink clicks statistics are a nice feature for low traffic sites there are number of problems arising from it - basically this kind of statistics means that for every pageview or link click Joomla has to write new data to a database. This has numerous implications:

  • On every article view Mysql UPDATE has to be run which slows a site down by itself
  • Constantly updated tables can't be cached by Mysql query cache (another slowdown)
  • If you are doing incremental/differential backups that store only changed parts of your site, new backup of the database will be created on every run even if your site hasn't changed for a long time. If you use remote backup services like Amazon S3 this will directly result in increased charges. With multiple sites or even few 1000 accounts holding multiple sites each in case of shared hosting providers, numbers can get quite significant.
  • If you are using built-in Joomla view cache (activated by turning on caching in global configuration) article statistic won't work anyway - page view is recorded only when cache expires and com_content is actually run to recreate it and so this statistic is totally unreliable.

 

By using this simple hack you can shrink your backups and improve your Joomla site's performance at the same time:

Beri dalje...
 
Showing different templates or sites to different visitors in Joomla

This is one of the Joomla's hidden features - there is builtin JBrowser library in Joomla that detects browsers and their capabilities and by using it you can show different template or content to different user types.

We are successfully using it on some of our sites to detect whether user/browser has javascript support (or is a robot) and redirect them later to appropriate site version with few simple lines of code:

 

Beri dalje...
 
Turbocharging your extension (with Joomla cache)

Video and slides from our "Turbocharging your extension" presentation at J and beyond, an international Joomla conference in Wiesbaeden, 30.5 - 1.6. 2010.

How to make your Joomla extension run up to 10 times faster!

 

Video


Get Flash to see this player.



Beri dalje...
 
Why URL as a cache id is inherently dangerous
While this article focuses on Joomla, this is also valid for all sorts of web applications - from Drupal to nearly all cache classes on phpclasses.org - they all use the same, inherently faulty approach.

 

Background

Caching is used in all sorts of software and hardware to speed up access to data that has been previously retrieved or generated - such data is stored and subsequent requests for the same data are quickly served from stored copy. The longer it originally takes to retrieve or generate some data, the higher are speed gains when data is served from cached copy.

With php web applications such gains are especially important as php and all surrounding web technologies are not particularly efficient and due to the nature of web there are a lot of request for the same data (multiple users viewing the same page). This inefficiency gets significantly bad when complex calculations or remote data accesses are involved and that's why nearly all advanced web applications make extensive use of various caching techniques.

 

Beri dalje...
 
Using caching in Joomla extensions

There is much confusion about Joomla 1.5 cache capabilities, it's variations and possible ways to implement it in extensions. Incomplete or missing documentation is the first to blame, but the fact that even core extensions didn't use cache until Joomla 1.5.15 or that they stop working properly when cache is turned on (related items module - fixed in upcomming 1.5.16 release, mainmenu etc.) doesn't help either.

I hope the following information will help you create another excellent extension that will not only do it's job, but will also be able to do it fast and scale well under a heavy load.

 

Give me speed! (Why bother by using cache at all?)

On a typical web site the same content gets displayed over and over again to anyone who visits your site. Without cache everything has to be generated for each and every page view - but caching can speed up this process by storing some or all of the information your code generates in a cache object and return it when next visitor requests the same page or particular piece of information.

Beri dalje...
 
Sodelujemo pri razvoju Joomle

Vodja naše agencije, Klas Berlič, je v decembru minulega leta postal član Joomla bug squad-a, ki je sestavni del razvojnega teama odprtokodnega projekta Joomla.

Klas je nasploh prvi Slovenec, ki mu je bila dana priložnost sodelovati pri razvoju tega projekta in je že tudi aktivno sodeloval pri nastanku zadnjih dveh različic sistema.

Joomla je najbolj razširjen sistem za urejanje spletnih vsebin (CMS) na svetu, ki beleži že več kot 9 milijonov namestitev. Med drugimi ga uporabljajo Združeni narodi, podjetje Danone itd, za izdelavo spletnih strani pa ga uporablja tudi naše podjetje. Sistem namreč omogoča uporabniku prijazno objavljanje in urejanje vsebin na spletnih straneh - urejamo in objavljamo lahko vse vrste vsebin, kot so novice, fotografije, dogodki, katalog izdelkov in podobno. V kolikor nam zmožnosti, ki so vključene v osnovno namestitev ne zadostujejo, nam je na voljo več kot 4500 razširitev. Vse to je mogoče zaradi odprtokodne narave projekta in njegove licence, ki omogočata brezplačno namestitev in uporabo, hkrati pa vzpodbujata tisoče programerjev po vsem svetu, da prispevajo k rasti projekta s svojimi razširitvami ali predlagajo različne popravke. Posledica takšnega modela sodelovanja sta skokovita rast in razvoj, ki mu na razvoj v posameznem podjetju omejeni, klasični sistemi, težko konkurirajo.

»V BzZzZ že od samega začetka uporabljamo odprtokodne rešitve kot konkurenčno prednost, saj se tako lahko posvečamo potrebam strank in ne izumljanju tople vode. Ves čas smo z manjšimi prispevki vračali skupnosti, kar smo od nje dobili, članstvo v JBS pa je le še en dokaz, da je naša usmeritev pravilna«.

 
<< Prva < Prejšnja 1 2 Naslednja > Zadnja >>

  • strateško usmerjeno
  • integrirano
  • s kreativnostjo pospešeno
  • učinkovito komuniciranje
© BzZzZ 2008
stik z nami    zaposlitev    kazalo strani