Project

General

Profile

Actions

Patch #7204

open

Caching of public pages, requested from anonymous users (10x - 20x speed improvements)

Added by Massimo Zaniboni about 13 years ago. Updated about 13 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-12-31
Due date:
% Done:

0%

Estimated time:

Description

I need a quicker access for public pages, requested from anonymous users.

I can not use a caching reverse proxy because the web proxy does not know when a page is requested from a registered user, or when the page is requested from an anonymous user.

In this patch the Ruby/Redmine application controller returns a page from the cache with ~ 10x - 20x speedup respecting normal pages. The caching is applied only if the user is anonymous (not logged) and only if the page does not contains forms with an authenticity token.

The cached page is different according the locale of user, so different pages for different locales are returned correctly.

The Redmine administrator can configure the cache refresh rate using the main Settings form.

The caching is performed using the caching method specified in the config/additional_environment.rb file. I added something like

config.action_controller.perform_caching = true
config.action_controller.cache_store = :file_store, File.join(File.dirname(__FILE__), '../tmp/cache')

I tested the patch on version 1.0.5, but it is not yet on a server in production.

The patch can be applied to r4595 or Git commit:6659c630b264325

Warnings / sorry in advance :-)
  • this is my first ruby code
  • this is my first ruby on rails code
  • I'm not a native english speaker, and probably my labels/texts is not completely correct

Many thanks for the good product that is Redmine!


Files

cache.patch (4.82 KB) cache.patch Massimo Zaniboni, 2010-12-31 03:47
redmine.patch (2.54 KB) redmine.patch Massimo Zaniboni, 2011-01-10 00:30
Actions

Also available in: Atom PDF