1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

dynamic or static content ?

Discussion in 'HTML, Graphics & Programming' started by ClearChaos, 31 May 2006.

  1. ClearChaos


    Joined: 8 Oct 2005

    Posts: 97

    Location: Bristol

    sitting wondering here what to do with one of my sites, its rapidly becoming a nightmare mostly from the admin area side of things

    if i want to add a product i get to choose from around 700 different sizes :eek:
    each related size will then have 2 prices/1 image/heavy item charge/weight and a picking list for the grunts in the warehouse, not to mention the 2 different related items lists/parent category/sub category and external links

    so i was thinking... i could ditch pretty much all of that and just use static pages built from templates on the back end that way i would never have to worry about insane sql statements/ado errors from googles cache and so on

    now i cant see a down side to this, has anyone here built site this way? any potential down falls to this?? or should i continue to give the mysql server a good spanking everytime i need to add a product
  2. Augmented


    Joined: 18 Oct 2002

    Posts: 5,464

    Location: London Town

    Static, definitely. Or, more accurately, dynamically cached static content.

    I'm not sure what language you're using, but since you mention MySQL I highly recommend the Smarty templating engine for PHP. The golden function it offers is is_cached() - meaning you only ever need to generate a page's output via the database the first time, and then run off the cached output until the time you wish it to expire and be regenerated. I build nearly every site I work on using it and have seen drastic reduction in load and number of connections when it's used properly.

    It also offers granular control of your cache - so you can recompile single, specific templates and cache files when you add a new product to ensure it appears on all the relevant pages.

    Of course you could write your own templating engine, or use a different one, but Smarty's one of the best.