Making Redmine friendly to page caches like Varnish

Added by George Notaras about 7 years ago

Hi all,

With this post I'm trying to start a discussion about what code modifications and server configurations would be required in order to make Redmine more friendly to page caches like Varnish.

I'm a huge fan of Redmine. I use it to organize my personal open source software projects and I really enjoy self hosting this application in order to meet my personal needs in terms of privacy. But there are two major disadvantages:

1) Like any Ruby-on-Rails application Redmine is a resource hog.
2) In addition to being hungry on server resources, it is also very unfriendly to page caches, which leads to the amplification of the effect of (1) as soon as some bots start indexing the web pages, especially when the 'issue tracker' and the 'repository' modules are enabled.

So, for me, trying to make Redmine more friendly to page caching proxies is very important. But what makes it so unfriendly to page caching? As far as I can tell, this is because a session cookie is set to all non-authenticated and authenticated clients (also naturally accompanied with the relevant non caching HTTP headers).

Consequently, the following questions arise:

1) Why non authenticated clients need a session cookie?
2) What information does it contain about the way they interact with the public pages?
3) Couldn't all that information be integrated into the path of the URL or into query arguments?

Then there comes the big problem with page caching: the invalidation of cached objects.

Of course, in a complicated web application like Redmine it is really difficult to generate the exact URLs of pages that should be invalidated after a modification, so this would have to be very vague and either be based on the module that has changed, eg issue tracker, and other related modules (example of invalidation request:{issues,roadmap,activity}/*), or project based (*).

In my opinion, being able to cache pages and invalidate them, even with this very vague logic, is much better than not being able to perform any page caching.

I really don't mean to waste anyone's time with all the above, but do you think that these concerns have any substance? Also, is the lack of page cache friendliness considered as a known problem by the community or it isn't taken into considation at all? I've searched this web site and the very little information that exists on the matter is really surprising, which makes me a bit skeptical about the possibility that I'm thinking about this in the wrong way..

Alternatively, memory based caching could be performed by Redmine itself by utilizing memcached or redis. Again I found very little information.

I wrote all the above in a fast pace. I hope they make sense. If you've reached that far, thanks! If you took the time to add a reply that clarified things, I'd be grateful!

Thanks in advance,