Mailing List Archive

Code caching issues?
Hi,

i'm building a portal website using EmbPerl. every page contains
some containers. the structure of pages (which containers are
displayed on page) are stored in a database, and so are the
containers together with their EmbPerl code.

the EmbPerl code is retrieved from the database BLOB field and
then included on the page using Execute().

everything works fine if you don't touch the containers. if you
alter the contents of some containers, occassionally snippets
of EmbPerl code (in [- -] brackets in the source) start to appear
in the HTML source. restarting Apache fixes the problem until
next edit.

EmbPerl version is 1.2.1. is this the caching issue resolved
by the last couple of patches?


Rgds,
Tfr

--==< tfr@cafe.ee >==< http://tfr.cafe.ee/ >==< +1-504-4467425 >==--
RE: Code caching issues? [ In reply to ]
Hi,
>
> i'm building a portal website using EmbPerl. every page contains
> some containers. the structure of pages (which containers are
> displayed on page) are stored in a database, and so are the
> containers together with their EmbPerl code.
>
> the EmbPerl code is retrieved from the database BLOB field and
> then included on the page using Execute().
>
> everything works fine if you don't touch the containers. if you
> alter the contents of some containers, occassionally snippets
> of EmbPerl code (in [- -] brackets in the source) start to appear
> in the HTML source. restarting Apache fixes the problem until
> next edit.
>
> EmbPerl version is 1.2.1. is this the caching issue resolved
> by the last couple of patches?
>

As far as I understand what you are doing, this is not a bug in Embperl.

Embperl caches the compiled Perl code you pass to it via Execute, so Embperl
needs to know when to the source changes, so it can recompile the Perl code.
This is done by the mtime parameter. Anytime your code, you read out of your
database has changed, you must change the value you pass to mtime. If you
don't change mtime when the source has changed, Embperl uses the old Perl
code, with the new HTML source, which couldn't work of course. (Also any
container must have a unquie string for inputfile, because Embperl uses this
text to distiguise the sources you pass to it).

If you are not able to provide the mtime value that changes everytime when
the source changes, that pass undef to mtime, this would recompile the perl
code for every request, but this will slow down your page

Gerald


-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------