shad.cc

To content | To menu | To search

Wednesday, July 21 2010

CirruxCache: Advanced configuration sample

That's it! This whole blog is cached and directly delivered by CirruxCache (only static files were cached before). My origin server is a tiny eeebox connected through my personal ISP.

So this configuration is a good challenge to offload my tiny web server as much as possible.

I think this is a good opportunity to show an example of a configuration which is a little bit more evolved.

The point is, I cannot set the same cache TTL for the whole website, and actually, I want to cache several websites...

# URL mapping
urls = {}
 
base = (
                '/_admin/(.*)', 'Admin',
                '/_store/(.*)', 'Store',
                '/_cron/(.*)', 'Cron'
                )
 
urls['default'] = base + (
                '(/debug/.*)', 'Debug',
                '/(.*)', 'Root'
                )
 
urls['www.shad.cc'] = base + (
                '(/themes/.*)', 'Blog_Static',
                '(/plugins/.*)', 'Blog_Static',
                '(/admin/.*)', 'Blog_Forward',
                '(/.*)', 'Blog_Page'
                )
 
urls['www.zaphod.eu'] = base + (
                '(/pub/.*)', 'Zaphod_Redirect',
                '(/.*)', 'Zaphod'
                )
 
# still supporting the old config
 
urls['cdn.shad.cc'] = base + (
                '/blog(/.*)', 'Blog_Static',
                '/(.*)', 'Root'
                )
 
urls['cdn.zaphod.eu'] = base + (
                '(/admin/.*)', 'Zaphod',
                '/(.*)', 'Root'
                )
 
# POP definition
# You can define and configure your Point Of Presence
 
class Blog_Static(cache.Service):
        origin = 'http://orig.shad.cc'
        forceTTL = 2592000 # 1 month
        ignoreQueryString = True
        forwardPost = False
        allowFlushFrom = ['x.x.x.x']
 
class Blog_Page(cache.Service):
        origin = 'http://orig.shad.cc'
        forceTTL = 3600 # 1 hour
        ignoreQueryString = True
        forwardPost = True
        allowFlushFrom = ['x.x.x.x']
 
class Blog_Forward(forward.Service):
        origin = 'http://orig.shad.cc'
 
class Zaphod(cache.Service):
        origin = 'http://orig.zaphod.eu'
        forceTTL = 2592000 # 1 month
        ignoreQueryString = True
        forwardPost = False
        allowFlushFrom = ['x.x.x.x']
 
class Zaphod_Redirect(redirect.Service):
        origin = 'http://zaphod.eu'
 
# !POP

I think this configuration is enough readable to avoid any explanation. However, do not hesitate to leave any comments.

Finally, I created a google groups to centralize all help requests. So if you need help, go to http://groups.google.com/group/cirr... or send an email to cirruxcache 'at' googlegroups 'dot' com.

Thursday, March 11 2010

CirruxCache 0.2.1 is released

I have just released a new version (0.2.1) of CirruxCache. To remember:

CirruxCache provides a software solution to dynamically cache HTTP objects on Google Appengine (using the Datastore and the Memcache services).

This new version includes an interesting set of features:

  • allow object flushing from restricted IP
  • configure a PoP (Point of Presence) according to a virtual host
  • several behaviors (cache, redirect, forward)

In more details, the last feature is the ability to configure a point of presence to differ from a classical caching mechanism. For example, I may want to configure "/admin/*" on my website to be redirected on the origin without caching.

Of course, this release includes several bugfixes, especially a fix on the "Expires" HTTP header which improves the caching performances.

Do not hesitate to test this new version and to comment any bugs or any suggestions.

Friday, October 30 2009

CirruxCache: speeds up your HTTP app using Google Appengine as a CDN

It is a great moment, for the first time since I have started to work at Zoomorama, I have just released as open-source an important part of our server platform.

I previously explained how to use Google AppEngine as a Content Delivery Network (CDN). CirruxCache project concretizes this idea. I released the first version based as the one we use in production.

Here is the features it currently supports:

  • honor Cache-Control
  • cache TTL override
  • several POP (Point Of Presence) configuration mapped on custom base-url
  • ignore query string
  • POST forwarding
  • expired entries garbage collection
  • extensibility


CirruxCache is not documented at the moment even if you would be able to use it after reading the comments in the app.py file. I'll document this app in the next few days, but if you need more documentation, don't hesitate to contact me.

The project website.