[wp-trac] [WordPress Trac] #59719: Revise caching approach for theme files

WordPress Trac noreply at wordpress.org
Fri Jan 5 23:17:00 UTC 2024


#59719: Revise caching approach for theme files
-------------------------+--------------------------
 Reporter:  flixos90     |       Owner:  joemcgill
     Type:  enhancement  |      Status:  assigned
 Priority:  high         |   Milestone:  6.5
Component:  Themes       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  2nd-opinion  |     Focuses:  performance
-------------------------+--------------------------

Comment (by spacedmonkey):

 Had some thoughts about cache invalidation.

 We could add a scheduled event that runs every say 15 minutes and does the
 following.

 One first run, loops through all of the installed themes, getting the
 current version number and last modified time of theme directory. Create
 an array of this data and store it in a network options or transient.

 One second run, loop through all installed themes, comparing against the
 stored version and last modified times. If either of these values do not
 match, call the delete_cache method on theme object. If there is also a
 mismatch, update the network option or transient.

 Themes are not updated that much, so this scheduled event way of cache
 clear could work well. It would mean invalidate caches until these run,
 but this is still better than what we have now.

 Running in scheduled event, means that this expensive check could be done
 in a background process or not on every page request.

 Thoughts?

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


More information about the wp-trac mailing list