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

Add HTTP Headers for cached pages with PHP #801

Closed
ambrosso opened this issue Mar 11, 2018 · 5 comments
Closed

Add HTTP Headers for cached pages with PHP #801

ambrosso opened this issue Mar 11, 2018 · 5 comments
Labels
community Issues created by someone outside of our team module: htaccess type: enhancement Improvements that slightly enhance existing functionality and are fast to implement wontfix Indicates that work won't continue on an issue or pull request

Comments

@ambrosso
Copy link

ambrosso commented Mar 11, 2018

How to add custom HTTP Headers for cached pages with PHP hook?
When server is not Apache, and thereis no access to NGINX server configuration.

For not cached pages HTTP Headers can be added with PHP in Plugin/functions.php/MU Plugin, but not for cached pages.
For all site, including cached pages, they can be added in wp-config.php file.

Is it possible to add HTTP Headers with some function or hook to WP Rocket plugin?
And how to add custom HTML content only to cached pages?

@ambrosso ambrosso changed the title How to add HTTP Headers for cached pages on NGINX server with PHP Adding HTTP Headers for cached pages on NGINX server with PHP - dont work Mar 11, 2018
@ambrosso ambrosso changed the title Adding HTTP Headers for cached pages on NGINX server with PHP - dont work Adding HTTP Headers for cached pages server with PHP - dont work Mar 12, 2018
@ambrosso ambrosso changed the title Adding HTTP Headers for cached pages server with PHP - dont work Add HTTP Headers for cached pages with PHP Mar 13, 2018
@carstenwawer
Copy link

Hi @ambrosso ,

did you have success in adding custom http headers to the cache?

I would like to add specific Content Security Policys on specific pages and searching a way to do that.

Thank & Best Regards!
Carsten

@remyperona remyperona added type: enhancement Improvements that slightly enhance existing functionality and are fast to implement module: htaccess labels Jul 25, 2018
@arunbasillal
Copy link
Contributor

@GeekPress @Tabrisrp This seems very specific and wouldn't apply to the bulk of our customers. Shall we close this?

If someone wants to do this:

  • Remove rewrite rules from .htaccess / Nginx config
  • Add the headers to wp-config.php (since this is executed before loading advanced-cache.php)

@GeekPress GeekPress added community Issues created by someone outside of our team wontfix Indicates that work won't continue on an issue or pull request labels May 15, 2020
@GeekPress
Copy link
Contributor

@arunbasillal You're right, let's closing this issue.

@BradFD
Copy link

BradFD commented Dec 15, 2020

Maybe this should be revisited in some form. Custom headers are needed to integrate with Cloudflare APO and likely similar offerings from other services in the future. #3180

Would also be nice to be able to add push headers for example for a logo to improve FCP. WP Rocket should also have the option to send a push header for its own concatenated/minified CSS and JS.

@TokyoJump
Copy link

WP Rocket user can not use 103 early hints in Cloud Flare.
We can not add custom link header.
This is issue, bug i guess.

It is not so cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues created by someone outside of our team module: htaccess type: enhancement Improvements that slightly enhance existing functionality and are fast to implement wontfix Indicates that work won't continue on an issue or pull request
Projects
None yet
Development

No branches or pull requests

7 participants