#985: BibFormat: lazy record formatting
------------------------+------------------------
Reporter: simko | Owner:
Type: enhancement | Status: new
Priority: major | Component: BibFormat
Version: | Resolution:
Keywords: |
------------------------+------------------------
Comment (by jcaffaro):
The implementation should consider the language used for formatting: one
should for eg. not cache the "es" version and serve it for further
requests in different languages.
This could be done by adding an "ln" column to the "fmtCACHE" table. To
prevent the table from growing too much the caching should create a
different language cache only when necessary. It is unfortunately not
possible to know a priori if a format make use of some
internationalization. The knowledge is on the developer/admin side. The
following options could be investigated (they do not exclude each other):
A. Add a config variable {{{CFG_BIBFORMAT_CACHED_LN = en,es,it}}} to
specify which language should be cached. Other languages could either be
served dynamically, or served using CFG_SITE_LANG (the customization of
this behaviour could also lead to the introduction of another config
variable).
B. Add an attribute (checkbox) to "output format" that admins set to True
when they consider that this output format would be worth serving
internationalized.
C. Add an attribute (checkbox) to "format templates" that admins set to
True when they consider that a template would be worth serving
internationalized.
D. Add an function to "format elements" that returns True when
developers plan this format element to return some internationalized
output.
E. The formatting could take place anyway if the cached version for a
given language is not found: if we find out that the output does not
differ from CFG_SITE_LANG, an empty row for this language could be created
in table "fmtCACHE" such that further formatting attempts would use the
data from row CFG_SITE_LANG.
Some other solutions exist and should be investigated. The above options
have different performance/storage costs: it would be interesting to let
the admins choose between one solution or another, based on their needs.
Note the existence of config variable
CFG_BIBFORMAT_DISABLE_I18N_FOR_CACHED_FORMATS (which might need to be
phased out or re-worked for the new BibFormat behaviour) which allows to
aggressively optimize the system by disabling internationalization for
some formats (internationalized formats do not exist on many Invenio
installations).
--
Ticket URL: <http://invenio-software.org/ticket/985#comment:1>
Invenio <http://invenio-software.org>