This module uses a method system_rebuild_theme_data() which invalidates theme and module caches. This method is implemented in an 'access callback' causing huge loads on our website. I would suggest caching the results of page_theme_get_themes() so system_rebuild_theme_data() wont get called more than once.

Comments

SpaghettiBolognese created an issue. See original summary.

spaghettibolognese’s picture

Assigned: spaghettibolognese » Unassigned
Status: Active » Needs review
StatusFileSize
new1.91 KB
rstamm’s picture

Assigned: Unassigned » rstamm
StatusFileSize
new1.96 KB

system_rebuild_theme_data() rebuilds, saves, and returns data about all currently available themes.
Not necessary to do it on every invocation of page_theme_get_themes()

In your patch cache_set() is being called on every invocation.
It should only be called when the data is rebuilt.

spaghettibolognese’s picture

Status: Needs review » Reviewed & tested by the community

You're absolutely right! patch looks alright, RTBC.

rstamm’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.01 KB

Actually we do not need system_rebuild_theme_data()
We just fetch the data from the database.

  • rstamm committed cbf0342 on 7.x-1.x
    Issue #2831129 by rstamm, SpaghettiBolognese: theme cache invalidation
    

  • rstamm committed cbf0342 on 7.x-2.x
    Issue #2831129 by rstamm, SpaghettiBolognese: theme cache invalidation
    
rstamm’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.