[wp-trac] [WordPress Trac] #59600: Block themes: Use a cache for block template files
WordPress Trac
noreply at wordpress.org
Thu Jun 13 14:05:20 UTC 2024
#59600: Block themes: Use a cache for block template files
--------------------------------------+--------------------------
Reporter: flixos90 | Owner: thekt12
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.6
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+--------------------------
Comment (by ivailohristov):
It seems like the main performance benefit here comes from having the
theme content grouped into a single object. I did a quick and dirty test
of the same logic but instead of using transients in the DB the object is
now saved as a simple file in the system's temp directory. In my tests
this performs even better than the current transient based implementation.
Do you think it is worth considering a file based implementation for this
instead of putting further stress to the DB?
Please take a look here: [https://github.com/felixarntz/wordpress-
develop/compare/performance/theme-template-file-contents...ivailohristov
:wordpress-develop:performance/theme-template-file-contents-cache]
Furthermore this implementation gets rid of the need for timeouts and
development mode. Theme changes are reflected immediately.
Here is how the averages for loading template paths look on my end (over
100 requests) when using transients vs file cache:
transients: 0.00062347412109375s
file cache: 0.00031973838806152s
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59600#comment:49>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list