• Sales: 1-800-961-2888
  • Support: 1-800-961-4454

Content Caching for Cloud Load Balancers


The Cloud Load Balancers product has a Content Caching feature that stores recently-accessed files on the load balancer for easy retrieval by web clients.

Getting started

Caching details

File types


Getting started

How do I enable content caching?

At this time content caching can only be enabled for a load balancer through our Cloud Load Balancers API.

What are the benefits of content caching?

Content caching improves the performance of a web site by temporarily storing data that was recently accessed. While it’s cached, requests for that data will be served by the load balancer instead of making another query to a web server behind it.

The result is improved response times for those requests and less load on the web server.

What kind of files work well with content caching?

Content caching works well for files that don’t change or that rarely change. Most images and static content are good candidates for content caching.

You don’t want to cache files that would change regularly or would be dynamically generated for different site visitors.

Caching details

Is there a maximum file size that can be cached?

The maximum file size per cached item is 2 MB.

How long is content cached?

Up to 10 minutes, depending on the load and amount of traffic being handled by the load balancer host.

If a cached file is requested shortly before it will expire, the load balancer will retrieve a new copy of the file early to prevent the file from being uncached during a period of heavy traffic.

Can I choose how long files will be cached?

No, not at this time. You cannot purge a file from the cache manually, but it will be automatically removed when its cache time expires.

Do nodes share a cache?

No. Each node has its own cache, separate from other load-balanced nodes.

Does cache carry over in a failover situation?

No. If a failover occurs the load balancer will retrieve a fresh copy of a file from the failover host.

File types

What file types are supported for content caching?

At this time the following file extensions are cached:

.png
.gif
.jpg
.jpeg
.ico
.wav
.mp3
.flv
.mpeg
.js
.css
.mp4
.swf

Can I exclude specific file types?

Yes. Have your web server set the Cache-Control header to no-cache for requests for the file types you don’t want cached.

You can set this header in apache by adding a config block similar to the following to your apache config:

<FilesMatch "\.(ico|flv|jpg|jpeg)$">
    Header set Cache-Control "no-cache"
</FilesMatch>

Replace the extensions in the “ico|flv|jpg|jpeg” section with the extensions for which you want to bypass caching, making sure to put a “|” character between each extension.



© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER

9 Comments

It would be very helpful if this could cache .html files.

Thanks Daniel. You might post that suggestion to our Product Feedback Forum:

http://feedback.rackspace.com/forums/71021-product-feedback/

Otherwise, a possible workaround would be to install a caching proxy server like Varnish that can sit in front of your application cache the static pages.

Thanks for the tip! Varnish looks like a great solution, I'll spin up a server now and try it out.

Do you reckon it will improve the site performance if we included varnish or is rackspace's content caching sufficient?

The load balancer caching should be sufficient for content that the load balancers will cache. If you add Varnish you can have it cache any content that you consider cacheable but that isn't covered by the load balancers. With the right configuration you could have varnish cache static html files, for example, or CMS-generated pages that don't change often.

You could also try CloudFlare. They offer caching of static content and delivery from CDN in addition to other options. They have a free plan, and it takes some of the load off your cloud servers.

Cloudflare is fast, free, and offers security too. They can bundle and compress js and css, but I do not believe they cache entire html pages.

Although the documentation states that this is only available via the API, it can also be set via the mycloud.rackspace.com control panel. It is under the "Optional Features" section of the balancer's detail page.

Thanks for catching that Ken. We'll look at getting the documentation updated.

Add new comment