Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 705839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:05:55+00:00 2026-05-14T04:05:55+00:00

There are loads of questions for the right PHP template engine, but none of

  • 0

There are loads of questions for “the right” PHP template engine, but none of them is focused on caching.

Does anybody know a lightweight, high-quality, PHP 5 based template engine that does the following out of the box:

  • Low-level templating functions (Replacements, loops, and filtering, maybe conditionals)

  • Caching of the parsed results with the possibility to set an individual TTL per item, and of course to force a reload programmatically

  • Extremely easy usage (like Smarty’s)

  • Modest in polluting the namespace (the ideal solution would be one class to interact with from the outside application)

But not Smarty. I have nothing against, and often use, Smarty, but I am looking for something a bit simpler and leaner.

I took a look at Fabien Potencier’s Twig that looks very nice and compiles templates into PHP code, but it doesn’t do any actual caching beyond that.

I need and want a template engine, as I need to completely separate code and presentation in a way that a HTML designer can understand later on, so please no fundamental discussions about whether template engines in PHP make sense. Those discussions are important, but there are specific questions for that issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:05:55+00:00Added an answer on May 14, 2026 at 4:05 am

    Template Engine with Caching

    • To answer your question I don’t know
      a template which support all your requirements. Hopefully somebody else can help you with that. But after a little bit of searching I found TinyButStrong. On there site they mention it has a cache system. I can’t find what kind of caching they implement(Disc/Memory/Database). It should cache in memory for truly speedups).

    Implement Caching yourself

    • I believe that Twig is a pretty solid
      template enine and that you can
      implement caching on top of that
      easily.
    • Just cache it in APC. When
      storing put a TTL(Time To Live)
      on it of. Then try to get it
      from cache.
    • I assume you already have APC
      installed, if you are concerned about
      performance (caching). Then the
      first thing you should install for
      performance is APC(A must because it also stores compiled PHP files in memory. This means it does not have to recompile every time). If you can not install APC then maybe you could check out
      Cache-Lite. I really liked this pear package for it’s simplicity/good documentation.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our legacy Java EE application, there are loads of value object (VO) classes
I'm trying to have a site set up so when the page loads there
Is there a way to determine which ClassLoader loads a specific class? Or more
Is there a version of require in ruby that either loads the whole file,
I have a page that loads an external HTML page into an iFrame. There
In a system I am currently working on, there is one process that loads
Ok this is more of a PHP question than mongodb but since i am
I've seen questions similar to this but haven't found an answer for my situation.
Alright so I have a custom page template designed with javascript and php (lets
I've asked this question before but I didn't seem to get the right answer.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.