Denis Ryabov
Forum Replies Created
-
1. I see the same error in JS console for disabled PageSpeed Ninja plugin as well.
2. Try to disable “Load external scripts” in “Leverage browser caching” section of Advanced PageSpeed Ninja settings.
3. I’d also recommend you to disable “Merge embedded scripts” in “Minify JavaScript” section to don’t merge embedded Google Analytics with other scripts.
Currently it is not implemented, and there is no way to do it easily. PageSpeed Ninja uses file wp-content/plugins/psn-pagespeed-ninja/cache/pagecache.stamp to automatically invalidate cached pages store before its modification timestamp, so it is sufficient to execute
touch ./wp-content/plugins/psn-pagespeed-ninja/cache/pagecache.stamp
in website root to trigger rebuilding of older caches (in latest WordPress versions PageSpeed Ninja updates pagecache.stamp automatically for many cases including editing of posts, etc.).
But we will try to add a feature to target specific posts/pages in next releases.
- This reply was modified 7 years, 10 months ago by Denis Ryabov.
PageSpeed Ninja’s cache works as follow. Initially, during activation, it detects that WP_CACHE is enabled (i.e. other caching plugin is active) and disables its own caching. But if you apply a preset after that, it may override Caching settings and switch to PageSpeed Ninja’s caching.
I’d recommend to disable caching in PageSpeed Ninja, remove wp-content/advanced-cache.php (if it’s not removed automatically), and re-enable caching in your caching plugin.
I’ll think how to avoid this issue in further releases.
It looks like your pages contain inlined scripts and styles that vary between pages (and result in independent merged files in /s directory).
Set following options to be disabled on Advanced tab of PageSpeed Ninja settings:Minify CSS > Merge embedded styles : Disable
Minify JavaScript > Merge embedded scripts : DisableMost likely either your homepage is cached in the browser (try to update it with Ctrl+F5 to check), or it is cached by 3rdparty caching plugin (just clear cache in that plugin in this case).
When you tested your website with Apache, did you use the same database? (not exported/imported into another one?)
And could you check that charset and collations for all your database tables (and database itself) are utf8-compatible (prefixed with “utf8”)?
What are values of DB_CHARSET and DB_COLLATE in wp-config.php?
I’m not sure replacing nonbreakable space by usual space is a good idea, because of sometimes nonbreakable spaces are useful (e.g. between initial and family name, or between number and unit, etc.). So, I’d replace str_replace by something like
return preg_replace(“(?<!\xC2)\xA0”, “\xC2\xA0”, $string);
that just replace non-UTF8 nonbreakable space by correct UTF8 byte sequence.
In your page sources you have characters with character code 160 (A0 in hex) that are not valid UTF-8. A0 is non-breakable space in most single-byte codepages, but in UTF-8 it is written as two-bytes sequence C2 A0. It is well-known issue, and most of browsers internally replace A0 by C2 A0, but PHP doesn’t apply this transformation. You can use “Fast” parser, and we will try to think what is possible to do with other parsers.
Fixed pagespeed.ninja sources, there was an issue in the page sources that is not related to PageSpeed Ninja optimizing engine.
As to your website, could you disable PageSpeed Ninja, save page content to file, and send it to hello-at-pagespeed-dot-ninja?
and
3) Do you use a 3rdparty caching plugin?
> are you saying if we successfully upgrade to 7.2.7 then we shouldn’t be seeing this “replacement character”
No. I’m just trying to guess where this issue may come from.
Few more questions:
1) What is the value of Content-Type header in website response headers? Is it “text/html” or “text/html; charset=utf-8”?
2) Do you set page charset using corresponding meta tag, e.g.
<meta charset=”utf-8″/>
(just open page sources in Chrome or Firefox browser using Ctrl+U shortcut)?To get PHP version (if unknown), you can look at website response headers (e.g. via Chrome or Firefox devtools), usually there is a header like
X-Powered-By: PHP/7.2.8
where 7.2.8 is PHP version. Alternatively, it’s possible to install “Display PHP version” plugin to get correct result (X-Powered-By header may be overwritten by both PHP and webserver).
Parameter mbstring.func_overload is located in php.ini file (it is disabled by default and is marked as deprecated in PHP 7.2).
The mb_output_handler function is rarely used thing, so unlikely it is used in your case.
What PHP version do you use? Do you use mb_string extension in mbstring.func_overload=2 mode? Do you use mb_output_handler (maybe via a 3rdparty plugin)?
Hmm, do you use UTF-8 charset on the website?
PS. Could you send me the link to the page you need help with? (hello-at-pagespeed-dot-ninja)
We have adjusted default caching lifetime settings in PageSpeed Ninja 0.9.29 and 0.9.30 (previously it set to was 15 minutes only). Starting from 0.9.30 time-to-live for internal fragment cache is detached from global “Caching time-to-live” parameter and is set to be at least 24 hours; it improves performance significantly even for 15 minutes TTL in the Safe preset.