criticalCSS icon indicating copy to clipboard operation
criticalCSS copied to clipboard

Add an option to set cookies that are passed to phantom

Open scottjehl opened this issue 11 years ago • 3 comments

scottjehl avatar Jul 10 '14 13:07 scottjehl

Going to expand on this - should also add the ability to pass in headers. Make it as close to a real request to a page as possible.

jefflembeck avatar Jan 28 '15 17:01 jefflembeck

If you guys are going to support cookies, would throwing in support for localStorage be out of the question?

listenrightmeow avatar Mar 14 '15 07:03 listenrightmeow

This tool itself doesn’t actually depend on or utilize cookies. The readme recommends that as an optional optimization you can take to avoid inlining once the full css is in cache, but it’s the sort of thing you’d need to wire up yourself in your server side templates.

The advantage with cookies here are that cookies are available on the server-side, so you can configure a template to directly reference your css file when the cookie is present.

LocalStorage options are fine to consider but they’ll require some JS processing on the client and I’m not sure how LS could be used to avoid inlining CSS on subsequent loads anyway. So, we’d recommend cookies if you can.

On Mar 14, 2015, at 2:06 AM, Michael Dyer [email protected] wrote:

If you guys are going to support cookies, would throwing in support for localStorage be out of the question?

— Reply to this email directly or view it on GitHub.

scottjehl avatar Mar 14 '15 16:03 scottjehl