futtta / ao_critcss_aas

Autoptimize power-up to integrate with criticalcss.com
9 stars 1 forks source link

differentiate non-logged vs logged on users? #102

Open futtta opened 5 years ago

futtta commented 5 years ago

As a user I can configure the plugin so that it will also make specific requests for critical css for logged in pages (and use it).

Criticalcss.com supports the customPageHeaders field as we discussed before, that can be used for this via sending a cookie header. This header that the user would specify to see a logged in version of the page - it would have to only be sent to criticalcss.com for logged in ccss requests - otherwise the logged out versions might stop working, if those pages redirect logged in users elsewhere.

It might also make sense one day, but perhaps not at the same time, to allow two versions of critical css for the same url - one for logged in users, and one for logged out ones.

futtta commented 5 years ago

@pocketjoso

-> this would require either the user providing the cookie value (most would have no idea) OR for AOCCSS to fetch that cookie itself somehow (i.e. get or create a session for a logged on user and extract the cookie somehow), this will not be simple -> additionally typically in wordpress different roles (and different users) might see different things, so even between logged in users the CCSS might be different ...