[wp-trac] [WordPress Trac] #42573: Templates not working properly

WordPress Trac noreply at wordpress.org
Wed Nov 22 06:11:00 UTC 2017


#42573: Templates not working properly
--------------------------+-----------------------
 Reporter:  precies       |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  high          |   Milestone:  4.9.1
Component:  Themes        |     Version:  4.9
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------

Comment (by dd32):

 Here's what I'm thinking for 4.9.1:
  - Page Templates: Remove the caching by default, keep it looking 1 folder
 deep only
  - File Editor: Allow opt-in caching, used mostly by the file editor
    - Reduce the cache time to a slightly more reasonable 5-15 minutes
 (instead of an hour), which seems plenty for a low-traffic area to me.

 Additionally these thoughts came to mind, based on the ticket feedback
 here:
  - Consider disabling the cache completely when `WP_DEBUG` is set - this
 seems like a bad idea. It'd effectively cause the cached template issue to
 not exist when a developer started debugging.
  - Consider only caching the data when fetching it takes longer than a
 threshold - Does it take 5seconds? Cache it. 50ms? Just query it every
 time - This could have unintended consequences, an issue which only
 happens sometimes, gone as soon as they start trying to fix it.

 Thinking out loud here, Filesystem caching has always been a minefield,
 the FS includes a cache already, unfortunately the act of accessing those
 directories can be slow even if the FS is caching information.

 The idea of only having the cache kick in if the speed of looking up this
 information was slow is an interesting one to me, it would effectively
 mean that there is no cache, but the moment that the hosts disk is
 overloaded or you have a 100-folder-deep theme then it starts to cache it
 for a short amount of time - hopefully long enough to let you do whatever
 you're doing without further delays.
 In this scenario the page templates would still be cached, but only if it
 was slow in the first place.

 Thoughts?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42573#comment:70>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list