Menu

#10 Output-Cache

closed
nobody
None
5
2003-06-11
2003-05-29
Anonymous
No

Hi,

with the knowledge of TTL and number of hits
and the functions mmcache_get, mmcache_put
and mmcache_gc it would not be difficult to
create an output-cache of php-files that behave
static for either x seconds (TTL) or y hits.

Only functions like get_ttl and get_hits would
be necessary to implement such a cache in <? ?>
php-sourcecode itself, but that solution would involve
the php-interpreter resulting in more overhead
than necessary.

Do you think it makes sense to add a further variable
to your shm data-structure: bool is_half_static_php?

When this variable is true and ttl and hits are
valid, turck cache would send directly the answer
(=the "old" static php-putput) without bothering the
php interpreter to Apache so that Apache will send
it to the user.

When ttl or hits are invalid (exceeded) turck cache
will ask php to process the script again, save
the output to shm and send this result back to
Apache.

And in order that turck cache knows to use this
static output system for this called script it justs waits
that the programmer
has called the function mmcache_manage(20,60);
in exactly this script.
Then mmcache sets is_half_static_php to true
and sets ttl to 20 seconds and the hits-limit to 60
for that script in SHM.

In order to remove this behaviour, the programmer
could send mmcache_manage(0,0); in it php-script to let
the script behave back as usual.

This would be an elegant and easy system to further
speed up server-response for "half-static" content.

Would it technically be possible that turck cache
can skate over php and its execution and directly
communicate with apache in such cases to speed up
the answer?

Thank you!

Discussion

  • Dmitry Stogov

    Dmitry Stogov - 2003-06-11

    Logged In: YES
    user_id=124551

    Dynamic content caching was implemented in Turck MMCache
    2.3.15. See "Turck MMCache API" section in README file for
    more details.

     
  • Dmitry Stogov

    Dmitry Stogov - 2003-06-11
    • status: open --> closed
     

Log in to post a comment.