[imc-sf-active] static sites with smarty

johnk at riceball.com johnk at riceball.com
Sat Dec 25 15:16:06 PST 2004


I'm really out of the loop on sfa dev, but, on LA, there's a 
semi-workable system to manage a page cache.

It's an old sf-a site, so news pages are generated PHP files.

If a page is missing, then we load a custom 404 Error page.  This page 
is a php page that looks at the URI, and generates the correct page.  
Then, the user is redirected to the newly generated page.  The process 
is transparent.

To update the site, you just delete all the generated files.  This will 
trigger a 404 error for each page, which triggers page regeneration.

The main problem with this are web spiders -- they tend to bog down the 
server, causing the system to hang.  A solution to this would be to 
monitor the system load, and refuse to generate pages for web spiders 
when the load is high.  This is only an issue for large sites.

Back to the PHP files.  These generated files have "include()s" all over 
them.  I don't think this is a problem. If it's important to put the 
include files into some kind of CMS, then, I would suggest just dumping 
the content into files, and include()ing them... though I suspect this 
wouldn't gain you very much.  It would probably be better to load all 
the templates into variables, and then print (or evaluate and print) 
them during page generation.


Pseudo Punk wrote:

>gekked at blackflag.net <gekked at blackflag.net> wrote:
>  
>
>>Hey all, please take a look at:
>>http://sfa.indymedia.org/news/2004/12/70.php
>>
>>I wrote up a summary of sf-active concepts so we can have a
>>grounding in what we're talking about towards a 1.0 release.
>>    
>>
>
>nice.
>  
>
>
>[...]
>  
>
>>>sitename/static
>>>    - we create per language (and if it's configured also $lang.'mix'
>>>      directories were static sites go. 
>>>    - mix is for presentation of a site in language $x but with content
>>>      
>>>
>>This part I'm not sure about. It would be nice to have includes and other
>>filesystem-dependent stuff become obsolete (which is doable with Page-Based
>>Editing). But, I don't really understand it and haven't looked too much 
>>    
>>
>
>i doubt this will work. the left column is mostly the same on all pages.
>so we can easily include it. if we don't include it, if you change it
>you'll have to regenerate everything. i guess for larger sites that will
>kill us. or did i misunderstand you ? (besides, mir uses includes as well.).
>
>also, includes, templates could go into the dbase it shouldn't be too
>hard to get them in there.
>
>  
>
>>at the new code. Ultimately, we do need some master script which could be
>>called the Producer that you can basically run and have it generate an 
>>entire site based on what it finds in the database. With the SF admin 
>>code, we're just about there with doing that. It works fundamentally just
>>like Mir, except their page definitions are accessible via XML and our
>>page definitions are accessible through SQL.
>>    
>>
>
>i so far used array's. but it's far from ready. > 
>  
>
>[...]
>  
>
>>This part I agree with and I included it in the Overview document I wrote.
>>    
>>
>
>one thing. why would replicated servers recache their articles if we could
>just rsync them to there as well ? 
>Bart
>
>
>
>  
>
>>-gek
>>
>>_______________________________________________
>>imc-sf-active :: http://sfactive.indymedia.org/
>>http://lists.indymedia.org/mailman/listinfo/imc-sf-active
>>
>>    
>>
>
>  
>


-- 
"Culture as Property is a Social Distortion."



More information about the imc-sf-active mailing list