Is your feature request related to a problem? Please describe.
Add a notification when Mod Pagespeed is enabled and tell customers that it is likely to conflict with WP Rocket, and that they should turn it off on their server to avoid any issues.
Describe the solution you'd like
We can check if Mod Pagespeed is enabled, maybe using the response header they send, and show notification on WP Rocket dashboard.
Describe alternatives you've considered
N/A
Additional context
Mod Pagespeed adds the following headers:
Related tickets - https://secure.helpscout.net/search/?query=tag%3Amod_pagespeed
Do we know why we have the conflict? Maybe we can work towards making WP Rocket compatible with mod_pagespeed rather than being incompatible with it.
cc: @sandyfigueroa @Tabrisrp
There is a lot of features duplication between WP Rocket and the pagespeed module. Working toward being compatible would be like working to be compatible with W3 Total Cache or Swift Performance.
Thanks for the feedback Remy ๐ Makes sense.
On a ticket I worked on, I had to exclude the following to prevent a jQuery not defined error:
/wp-includes/js/jquery/jquery.js,(.*).js
The URL of the jQuery file was like this:
https://www.example.com/wp-includes/js/jquery/jquery.js,qver=1.12.4-wp.pagespeed.jm.gp20iU5FlU.js
What do you think about at least excluding that pattern in the core?

Related ticket: https://secure.helpscout.net/conversation/1335093437/210973?folderId=2135277
@vmanthos If we are going ahead with the notice suggesting to disable Mod Pagespeed, then is this still required? Or is this one of the most common issues where some users could still get by without disabling mod_pagespeed?
My comment was out of context. I apologize.
If we are going ahead with the notice suggesting to disable Mod Pagespeed, then is this still required?
In such a case, it won't be. ๐
Create new thirdparty compatibility class here: inc/ThirdParty/Plugins/PageSpeed.php
Create new method to check if pagespeed is enabled as follows:-
private static function has_pagespeed () {
if ( function_exists( "apache_get_modules" ) ) {
if ( in_array("mod_pagespeed", apache_get_modules(), true ) ) {
return true;
}
return false;
}
if ( function_exists( "get_headers" ) ) {
if ( ! empty( $_SERVER["HTTP_HOST"] ) ) {
if ( ! empty( $headers = get_headers(home_url() ?? null ) ) ) {
if ( ! empty( $headers["X-Mod-Pagespeed"] ) || ! empty( $headers["X-Page-Speed"] ) ) {
return true;
}
}
}
}
return false;
}
admin_notices to show the message.[S]
@wp-media/productrocket we need the message that will appear to the customer.
@wp-media/productrocket @arunbasillal we have two questions please:-
Where is the message to be displayed?
Do we need to show the notice only at WP Rocket settings page or in all pages?
Thanks.
@engahmeds3ed @Tabrisrp
Deactivate and a doc opens up)Is this possible? If yes, I will have a chat with Jonathan and confirm.
@wp-media/productrocket so the message will be like that:
WP Rocket: The following modules are not compatible with this plugin and may cause unexpected results:
- Mod Pagespeed: Read more
Please confirm.
@arunbasillal @webtrainingwheels Is it the expected doc to link?
@GeekPress @webtrainingwheels I think we could create a specific documentation for the same. Or maybe a separate section in the doc with an #anchor text.
Please advise Lucy.
Had a quick chat with Ahmed and he said that we are not reusing rocket_plugins_to_deactivate(), and instead we are doing a new notice. (For reference, I had asked if this was possible to re-use - https://github.com/wp-media/wp-rocket/issues/3369#issuecomment-740163957)
@webtrainingwheels In that case, isn't it better if we simply have a notice as below instead of - https://github.com/wp-media/wp-rocket/issues/3369#issuecomment-750200923
WP Rocket: Mod PageSpeed is not compatible with this plugin and may cause unexpected results. More info
@arunbasillal @GeekPress
In our current docs we mention mod pagespeed in 2 places:
We could make a dedicated doc but what message/info would we like to convey? ๐ค
@webtrainingwheels
We could make a dedicated doc but what message/info would we like to convey?
@wp-media/productrocket

This is the message view after adding it ( only waiting for docs url )
also I need to validate another point here,
check the following comment: https://github.com/wp-media/wp-rocket/pull/3390#issuecomment-750334876
we are saving the status of mod_pagespeed existence at transient for 1 day so we will make this check every day, I added this 1 day from my mind and only wanted to validate if this will make any problem with our customers or not?
@engahmeds3ed Here is the doc link: https://docs.wp-rocket.me/article/1376-mod-pagespeed
we are saving the status of mod_pagespeed existence at transient for 1 day so we will make this check every day, I added this 1 day from my mind and only wanted to validate if this will make any problem with our customers or not?
@engahmeds3ed Can we make the notice dismissible instead or it popping up every day? If users do not see a conflict with WP Rocket and wants to keep mod_pagespeed, they can simply dismiss the notice and never see it again. I think that would be better. If the notice pops up every day, we are definitely going to have users asking for an option to disable it.
@arunbasillal It's already like that so the clients can dismiss the message not to see it again.
I mean that if message is shown and then client removed mod_pagespeed so the message will disappear the next day or he can dismiss it for sure.
@engahmeds3ed To make sure I understand correctly:
In this case the notice is never displayed anymore, right?
(sorry for double checking)
Yes it will be like that one:

and when clicking on Dismiss this notice it will be removed for this user for ever.
I will check with you on slack when you are available.
@engahmeds3ed That looks neat to me ๐
Just stumbled across this message in WP Rocket, and after disabling mod_pagespeed on the server, our PageSpeed Insight results have regressed.
I think this message should explicitly state which specific features are not compatible, so the user can decide if they would like them managed at the application or server level.
Could some of these optimisations actually be better managed at the server level?
Could some of these optimisations actually be better managed at the server level?
I can't see which feature done by mod_pagespeed could be better than what another tool like WP Rocket does.
@GeekPress Even so, the existing message is very vague (unexpected results!).
-The only 100% conflict I'm aware of is with optimize css delivery and we mention it here:
https://docs.wp-rocket.me/article/1321-critical-css-issues-fouc
If this statement by @webtrainingwheels is correct, then many may find it easier to just disable critical CSS in WP Rocket, than perform server administration uninstalling mod_pagespeed.
@twobyte Critical CSS is too much important to be disabled. Please correct, but mod_pagespeed doesn't do CPCSS as it should be done correctly.
By the way, mod_pagespeed isn't maintained since 2015. We will never recommend using an abandoned tool.