Jump to content

Flatfile or MySQL Templates?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
mikelbring

mikelbring

    Programmer

  • Members
  • PipPipPipPip
  • 118 posts
I am coding the framework for my new site and in the past ive always used a mysql template system. But I am considering using flatfiles but not sure on this one. Currently what I do is select all templates in the global and put them each into a variable so then I run my fetch_template function which will eval the template variable. Why do I select them all at once, because if I run the same query so much then mysql should cache it.

But I want to know if my system would be faster to use flatfiles and if I went this route should I simply do includes or actually readfile? Thanks

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
I don't get why you read them all at once (turn off caching). How many templates are there? Using a database is cleaner code, IMO but using a file would be faster. You could also use SQLLite with PHP which is essentially a flatfile database.

#3
mikelbring

mikelbring

    Programmer

  • Members
  • PipPipPipPip
  • 118 posts
Well if I read them all at once then mysql would get use to the same process over and over and would essential cache it.