Feature: Smarty template PHP cache #319
Labels
No labels
bug
confirmed
critical
discussion
documentation
Doing
enhancement
experiment
suggestion
support
Testing
To Do
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: hazaar/framework#319
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
The current implementation of the Smarty template engine in Hazaar compiles templates into PHP in memory and executes them using
eval()
. While this approach is efficient for small templates (such as emails or text content), it is suboptimal for larger HTML templates used in the Hazaar view system. Executing large templates viaeval()
introduces unnecessary overhead and security concerns. A more efficient caching mechanism is needed to store compiled PHP templates on disk and execute them using PHP’sinclude
function.Who will benefit?
Benefits and risks
Benefits
eval()
for large templates.eval()
to smaller, transient templates.Risks
eval()
versusinclude
.Proposed Solution
loadFromFile()
.eval()
for templates loaded vialoadFromString()
.include
function to execute cached templates instead ofeval()
.Priority/Severity
assigned to @jamie
created branch
319-feature-smarty-template-php-cache
to address this issuementioned in merge request !200
mentioned in commit
0bd11eda0d
mentioned in merge request !201