Hi,
I noticed that themekey is evaluated on requests to
js/admin_menu/cache/...
This is probably no biggie in itself. But if there is an expensive rule at the top, we will get a performance penalty.
The effect is similar for other non-html requests or for ajax.
For ajax, I think it is more difficult: We probably want to get the same theme as on the embedding page.
Even on other non-html or ajax pages, the theme choice might still be relevant.
So.. how can we solve this?
I would suggest
- so something smart for ajax requests, to use the same theme as on the embedding page.
- by default, put a themekey rule at the top targeting js/admin_menu, to suppress any further rules evaluation.
Ok, this is probably not the final wisdom. Maybe you have better ideas (or something is already implemented).
Comments
Comment #1
mkalkbrennerThemekey already contains code to supress invoking the rule evaluation. The logic bases on paths and includes some well known ajax paths.
Maybe that list of paths should become configurable.
Regarding the smart switch when to use the theme of the embedding page, there's an existing issue: #1525016: Mixed themes when using ajax
Comment #2
donquixote CreditAttribution: donquixote commentedOk. In this case I just want to say that js/admin_menu/cache is not suppressed :)
Comment #3
mkalkbrennerComment #4
mkalkbrennerComment #5
mkalkbrennerAdded hook_themekey_disabled_paths() to add paths where rule evaluation is avoided.
"js/admin_menu/cache" gets added by themekey_admin_menu_themekey_disabled_paths().
Other parts are solved by #1525016: Mixed themes when using ajax.
Comment #6
donquixote CreditAttribution: donquixote commentedSounds good!