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.

Is there performance hit running templates as text files?

April 25, 2008 2:46pm

Subscribe [4]
  • #1 / Apr 25, 2008 2:46pm

    Dan Lewis

    24 posts

    For development purpose, I run all templates as text files.  Now I have migrated the site to a live server.  Is there a performance hit or should I turn it off?

    If I should turn it off on the live site, what’s are the recommended steps?  Do I go to every single template to reload the content, un-click the “Save Template as File” checkbox and save it into database.

  • #2 / Apr 25, 2008 3:27pm

    PXLated

    1800 posts

    Don’t have any thread pointers but from everything I’ve read, there is no performance hit of any consequence, if at all.

  • #3 / Apr 25, 2008 11:07pm

    Derek Jones

    7561 posts

    There is additional disk i/o for the file, of course, but it’s just read access, so unless you have an unusually high traffic site, I don’t think even anyone monitoring the server closely would notice a blip.  And if you _do_ have an unusually high traffic site, it’s likely that you already have a server environment with a disk array that can handle it.

    That said, there is convenience to keeping it all in the database on a production site.  If your host (or you) make regularly scheduled database backups, then the templates are included with such a backup.  Perhaps not a big deal if you also make regular file backups, but I prefer to keep everything in one place when I can.

  • #4 / Apr 28, 2008 2:08pm

    Dan Lewis

    24 posts

    Thanks to all.  I will leave the templates as text files then as it makes porting the template changes over much easier via FTP.

  • #5 / Apr 28, 2008 2:43pm

    PXLated

    1800 posts

    Once a site is live and stable, I usually take it into the database as I’m rarely accessing with anything major. It is kind of a pain as you need to visit every template, switch the file save off and refresh. Wished there was a master switch 😊

  • #6 / Apr 28, 2008 4:29pm

    Ingmar

    29245 posts

    A master query, perhaps?

    UPDATE exp_templates SET save_template_file = "n" WHERE save_template_file = "y"

    Untested, so use at your own risk 😊

  • #7 / Apr 28, 2008 5:19pm

    PXLated

    1800 posts

    Thanks Ingmar, don’t have anything to test on at the moment but have the code so will try when possible.

  • #8 / Apr 28, 2008 5:21pm

    Derek Jones

    7561 posts

    Well, you still need to save via the form, or EE will serve the potentially-stale database version of the template.

  • #9 / Apr 28, 2008 5:25pm

    Ingmar

    29245 posts

    Ouch, good catch there. So, there’s no way to fully automate that, Derek?

  • #10 / Apr 28, 2008 5:32pm

    Derek Jones

    7561 posts

    Well, no one-line way.  A quick PHP script in a template could handle it, grabbing content from files of all saved templates, and updating the database.

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

ExpressionEngine News!

#eecms, #events, #releases