ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Advice needed on PHP-adjustment of template-caching mechanism

December 30, 2007 11:23am

Subscribe [3]
  • #1 / Dec 30, 2007 11:23am

    Patrick Savalle

    31 posts

    Hi, I built a social blogging system using EE.

    It’s on http://zaplog.nl

    If features individual weblogs, every user has its own weblog on it’s ‘own’ url. For instance:

    http://warp11.zaplog.nl/site
    http://p.uncia.zaplog.nl/site

    I use code like this in my templates:

    <?php 
        global $HTTP_HOST;
        $site = substr($_SERVER[HTTP_HOST], 0, strpos($_SERVER[HTTP_HOST],'.zaplog.nl')); 
        $host = 'http://'.$_SERVER[HTTP_HOST]; 
    ?>

    I need two things which I can probably modify myself in EE, but I need advice from someone who cvan oversee the modifications.

    1. I (think i) need a much higher maximum number of cached pages. The limit now is 1000, can I alter EE to accomodate 2500 or more pages? There is lot’s of room on my server.

    2. I need EE to cache complete URL’s. Right now it decides on caching a page using the last part of an URL. So to the caching mechanisme these are the same pages:

    http://warp11.zaplog.nl/site/related/afghanistan
    http://p.uncia.zaplog.nl/site/related/afghanistan

    Because the last part is ‘site/related/afghanistan’ in both cases.

    I need EE to cache based on the complete URL’s since in reality the pages above are different pages. Can this be done by a simple PHP-tweak in some core-file? What will be the consequenses?

    I changed core.template.php line 2277 to facilitate this. I changed the hash-key calculation to incorporate the complete URL.

    From:

    $this->cache_hash = md5($site_id.'-'.$template_group.'-'.$template);

    to

    $this->cache_hash = md5($_SERVER[HTTP_HOST].'-'.$site_id.'-'.$template_group.'-'.$template);

    But I cannot oversee the complete archicture of EE so can Derek or so look at this?

  • #2 / Dec 31, 2007 12:53pm

    Leslie Camacho

    1340 posts

    You should review the ExpressionEngine License as building a social blogging site is prohibited under most circumstances. If you have questions about the license, please .(JavaScript must be enabled to view this email address).

    In any case, what you are asking is well beyond the scope of technical support as we do not support building social network applications with EE.

    Thread closed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases