Mailinglist Archive: yast-devel (77 mails)

< Previous Next >
Re: [yast-devel] Profiling web-client
  • From: Ladislav Slezak <lslezak@xxxxxxx>
  • Date: Mon, 07 Dec 2009 17:20:57 +0100
  • Message-id: <4B1D2B69.7030704@xxxxxxx>
On 7.12.2009 14:38, Josef Reidinger wrote:
comments:
add 2) I create bug - https://bugzilla.novell.com/show_bug.cgi?id=561265 . It
should be easily cached, as permission for target host is not changed often.
So on login it could be stored in local db information about permissions.

It can be cached, I have a patch prepared for that (will be committed after the
release). The first full request takes ~200ms in a Virtualbox VM,
the following (repeated) requests take ~10ms.


add 3) I create bug -https://bugzilla.novell.com/show_bug.cgi?id=561283 . It
can be cached as well, as routes for interface is not changed. So at least
during login it should be stored and then used.

Another patch in my queue is caching ResourcesController#index, but this call
was
fast even without caching (speed up from ~15ms to ~5ms).

I tried even enabling page caching ResourcesController#index result. Page
caching
creates a static file (resources.xml) file in public/ and the following requests
use this static file without any Ruby/Rails interaction. The speed is then the
same
as serving a static file (i.e. no Ruby or Rails in the path).

The drawback is that public/ must be writable for the webserver process. And
this can
be a potential security problem...

Caching ResourcesController#index result using action caching is really simple:

--- a/webservice/app/controllers/resources_controller.rb
+++ b/webservice/app/controllers/resources_controller.rb
@@ -1,5 +1,6 @@
class ResourcesController < ApplicationController
require "resource_registration"
+ caches_action :index

def index
@resources = Resource.all


(Note: caching is enabled only in "production" mode or you have to
modify config.action_controller.perform_caching option in
config/environments/development.rb file)

--

Best Regards

Ladislav Slez√°k
Yast Developer
------------------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: lslezak@xxxxxxx
Lihovarsk√° 1060/12 tel: +420 284 028 960
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References