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

Feature Request: Option to disable HTML Notes when request is excluded from being cached #423

Open
raamdev opened this issue Feb 26, 2015 · 3 comments

Comments

@raamdev
Copy link
Contributor

raamdev commented Feb 26, 2015

It would be useful to have an option on all three Quick Cache Exclusion option panels that allows a site owner to disable the Quick Cache HTML notes whenever a request matches an exclusion pattern.

This would be particularly useful when the HTML notes indicating a specific request is not being cached interferes with the request itself, such as when serving a gzipped XML feed in some server configurations (see #422 and this report).

The following Quick Cache options could have an additional section that allows for disabling HTML Notes whenever a request matches the exclusion pattern:

  • URI Exclusion Patterns
  • HTTP Referrer Exclusion Patterns
  • User-Agent Exclusion Patterns

The default would be to show HTML Notes when a request matches an exclusion pattern. Also, the global HTML Notes option in Quick Cache ⥱ Plugin Options ⥱ Enable/Disable would override these secondary options only when the global option is set to "No, don't show notes".

@jaswrks
Copy link

jaswrks commented Mar 15, 2015

Unrelated to this feature request...

In this report that you referenced above, I am not clear on how this could even occur. If GZIP is being handled by Nginx that should not impact the output of a PHP script, no matter what the output contains, i.e., HTML comment or no HTML comment.

Whenever GZIP is being handled by a secondary filter that resides outside of PHP, the deflating occurs after PHP output is generated. Thus, it would seem to me that the problem reported in that thread is related to a bug or misconfiguration of Nginx, not in ZenCache.

My guess is that the Nginx GZIP methodology being used is choking on the comment left at the bottom. Reproducing this would help to clarify. I'm just not really clear on how that can even happen unless there is a bug in the Nginx config.

The way it plays out is this...

  • Nginx receives a web request for a PHP file.
  • Nginx forks the request to PHP for processing.
  • Nginx receives the output from the PHP script.
  • Nginx is configured to enable GZIP output compression.
  • Nginx applies GZIP if the PHP script supplies a compressable Content-Type.

So how does one end up with an uncompressed comment line at the bottom?


It almost sounds like GZIP compression is being applied by PHP itself in this case, unbeknownst to ZenCache who then later adds the HTML comment line. If that's the case, it's an entirely different issue and we need to see if that can be reproduced at some point.

@raamdev
Copy link
Contributor Author

raamdev commented Mar 17, 2015

@jaswsinc Copy that. Thanks for following up. I'm labeling this needs testing.

@raamdev
Copy link
Contributor Author

raamdev commented Dec 29, 2016

Removing the needs testing label, as this is just a feature request and this GitHub issue is not related to Jason's comment above. I haven't seen any further reports of issues with Nginx + GZIP + HTML Notes, so I'm not even going to fork that to a separate GitHub issue.

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

No branches or pull requests

2 participants