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

mkalkbrenner’s picture

Themekey 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

donquixote’s picture

Ok. In this case I just want to say that js/admin_menu/cache is not suppressed :)

mkalkbrenner’s picture

Title: Suppress themekey evaluation on ajax and non-html requests? » Make suppressing themekey evaluation on special paths (p.e. ajax) configurable
Assigned: Unassigned » mkalkbrenner
mkalkbrenner’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
mkalkbrenner’s picture

Title: Make suppressing themekey evaluation on special paths (p.e. ajax) configurable » Add a hook to suppress themekey evaluation on special paths
Issue summary: View changes
Status: Active » Fixed

Added 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.

donquixote’s picture

Sounds good!

Status: Fixed » Closed (fixed)

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