Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with nginx fastcgi_cache #53

Open
mundschenk-at opened this issue Jan 18, 2016 · 8 comments
Open

Incompatible with nginx fastcgi_cache #53

mundschenk-at opened this issue Jan 18, 2016 · 8 comments
Assignees
Labels
Milestone

Comments

@mundschenk-at
Copy link

Unfortunately, the plugin is currently incompatible with nginx' fastcgi_cache. When the plugin is enabled, the cache is never hit (most likely due to the session cookie set in every response header, even when a page does not contain a comment form).

@Vernal
Copy link
Contributor

Vernal commented Jan 20, 2016

Hey @mundschenk-at when did you discover this and how can we reproduce? Can you give me more data?

@mundschenk-at
Copy link
Author

I've set up a fastcgi_cache for our multisite network so that non-logged in users get a response directly from nginx instead of PHP. A few days ago, I noticed that the time-to-first-byte for my main blog was way too high for them to come from the cache. I added a caching indicator to the header, and indeed, every request was a cache miss (not bypass!). I also noted that Postmatic Social set a session cookie in that header (even for the start page, which does not contain a comment form!).

When I disabled Postmatic Social, the cache was hit normally again. I've not delved too deeply into the fastcgi_cache module, but I think by default it adds the cookies to the cache key, resulting in a miss all the time if the session cookie is not the same.

@Vernal Vernal added the bug label Feb 1, 2016
@Vernal Vernal added this to the 1.1 milestone Feb 1, 2016
@Vernal
Copy link
Contributor

Vernal commented Feb 1, 2016

@filkaris do you want to start by looking into PMS setting cookies when it should not... and then, if it's a good fit, look into fastcg_cache compatibility?

@Vernal
Copy link
Contributor

Vernal commented Feb 22, 2016

Note from a user this weekend... could be a good lead:

It looks like Postmatic Social Login sets a cookie on every page load even if the plugin is not configured yet.

On some hosts using Varnish and the like, cookie activity like this will always cause a cache miss, rendering the server caching useless. Flywheel in particular has this reaction to plugins that behave this way.

@Vernal Vernal assigned cyberhobo and unassigned Vernal Mar 9, 2016
@Vernal
Copy link
Contributor

Vernal commented Mar 9, 2016

Hey @cyberhobo do you have any thoughts on this?

@cyberhobo
Copy link
Contributor

I can verify the behavior and identify the code setting the cookie:

https://github.com/postmatic/postmatic-social/blob/master/functions/Postmatic_Social_Comments_Session.php#L28

Unfortunately that session is made global which might make it a bit of a job to figure out everywhere it's used and how it can be refactored.

@Vernal
Copy link
Contributor

Vernal commented Mar 10, 2016

Ok let's push this to 1.2. Assigning to @filkaris for him to poke at.

@Vernal Vernal assigned filkaris and unassigned cyberhobo Mar 10, 2016
@Vernal Vernal modified the milestones: 1.1, 1.2 Mar 10, 2016
@mundschenk-at
Copy link
Author

Any news on this? I'd like to use the plugin, but with this bug in place, I can't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants