Here's a patch which refactors this module to build the cookie based on the breakpoint contexts in the system rather than the user's browser dimensions. The motivation for this is to vastly decrease the amount of unique cookies created for caching purposes.

This makes the cookie an array of all the breakpoint contexts in the system, and whether each of them is active or not at the time it's being checked (when the user loads the page and when the browser is resized).

Comments

sethfisher’s picture

theduke’s picture

Status: Needs review » Fixed

Hey, sorry for the delay.
We ran into the exact same issue with caching.

I did not use your code directly, but your idea, so thank you!

The 7.x branch now contains the update, and I will release a new version soon.

I also added an option in the context settings for enabling the resolution cookie, since in some situations it is very helpful or even necessary.
This is off by default though!

Status: Fixed » Closed (fixed)

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