[Koha-devel] FW: RFC: /svc/ API

David Cook dcook at prosentient.com.au
Fri Jul 25 02:15:57 CEST 2014


You're very welcome, Petter. I'm happy to be having this discussion!

I've included some inline comments below as well.

> I also think it can be used for more static data, which rarely change.
> Say for example the list of branches (we have around 30) which 
> populates dropdown several places the staff interface. If this was 
> fetched after page load, by an AJAX request to, say, GET 
> koha/rest/v2/branches, we could set the Cache expiration headers, (to 
> a day, or a month, I dunno) then the browser would cache this 
> particular request, and thus not touch the database at all except when 
> cache expires. For frequently used pages this could lead to a lot of 
> less traffic to the database. Then there is the problem of when you 
> actually DO change this "mostly" static data, like branches... Well, 
> either you can wait until cache expires, you can force to reload (Cltr 
> +R, or Cltr + F5 in most browser), or we must implement some logic on
updates which modifies the cache expiration headers.

I don't have much experience with caching, but that sounds interesting.

One worry I have about using AJAX in the OPAC is the second or so that it
can take to load an element on a page sometimes. The page loads and then
elements can "jump". For instance, I added a drop-down menu for "Collection"
next to the masthead search box. It didn't load very smoothly. I wonder if
it would if it were cached as it doesn't need to do that database query. 

Of course, loading search result facets would take longer, but we could add
a "Loading..." or "Calculating facets..." message in that case, so that
users would know what the system is doing.

> Some more benefits of Koha using its own APIs:
> - They are kept up to date since they are used by Kohas core
> - More thought is being put into layout, organization and 
> implementation of the API, as it
>   not just for "someone else", some third-party integration, but for 
> Koha itself.

Agreed. Since Koha would be both client and server, I think more care would
be put into architecture. Since it would depend on its own API, it would
have to be up-to-date.


David Cook
Systems Librarian
Prosentient Systems
72/330 Wattle St, Ultimo, NSW 2007







More information about the Koha-devel mailing list