Troubleshooting: 0 cache
-
Good afternoon! My website is heavily imaged based so was excited to see your plugin could optimise my library for mobile usage. I verified that my server is Apache and followed the install instructions. As far as I’m aware, I’m not using a CDN or caching server, yet the plugin has been returning “cache: 0” for several days. I have visited using three phones, a tablet and responsive simulation via Chrome. I have been through my plugins, turning on and off to check clashing, but still haven’t got to the bottom of this. I wondered wether the issue laid with my images being scaled by a percentage rather than set pixels at defined break-points? Your thoughts would be much appreciated. Thank you. Regards, N.
-
Hello, my friend,
Thank you for reaching out to us. It seems that you have already gone to the trouble of looking into the problem yourself quite a bit, so I am not going to ask you the usual questions.
I would be glad to take a look at your images if you could share your website url with me.
Cheers,
TakisHello Takis, the URL is http://www.thisisneil.com
I’ve re-enabled all plug-ins.
Thanks for your time.
Neil.Hello again, my friend,
Thank you for sharing your website url with us.
I see that your images are in the form of http://www.thisisneil.com/wordpress/wp-content/uploads/2016/02/thisisneil_RickGuestWebsites_1.jpg, so you have probably set your WordPress installation in a subdirectory named
/wordpress, as described in https://codex.ww.wp.xz.cn/Giving_WordPress_Its_Own_Directory.Unfortunately, this is a case that our plugin did not take into account up to its current version. It has been thoroughly discussed here https://ww.wp.xz.cn/support/topic/htaccess-path-to-adaptive-images-script-php-is-always-wrong/ and a workaround has been found by @milenoi2016. This workaround is also mentioned in https://ww.wp.xz.cn/support/topic/not-creating-cache-folder/#post-8518649.
What you need to do is go to the plugin folder and:
// In adaptive-images-actions.php file // Remove the $request_uri_base here: $adaptive_images_php_script = $request_uri_base. '/' . $adaptive_images_dir_path_relative . '/adaptive-images-script.php'; // So it becomes: $adaptive_images_php_script = '/' . $adaptive_images_dir_path_relative . '/adaptive-images-script.php'; // Actually simply remove the $request_uri_base.I know this is a dirty and temporary way to fix the problem, but it will be included in the next versions of the plugin.
Let me know if this works for you.
Cheers,
TakisAfternoon Takis.
Firstly, again, thanks for your help.
Having followed the steps above, the problem persists. I’ll sit tight and wait for an update.
Cheers,
N.Hello, again,
Terribly sorry to hear this! Maybe I was wrong in my original guess. Can you confirm you have set your WordPress installation in a subdirectory named
/wordpress, as described in https://codex.ww.wp.xz.cn/Giving_WordPress_Its_Own_Directory/? If not then, I am probably pointing you to the wrong direction.Cheers,
TakisHello Takis,
Yes, my installation is set within /wordpress
Giving me the following cache path:
/wordpress/wp-content/cache/adaptive-imagesThanks.
N.Hello, again,
If the above fix I proposed did not do the trick, then things are starting to feel quite weird. But let me try to get to the bottom of this. If I am not troubling you, may I ask a couple more questions:
- Could you please send me the output of the Print debug and the Print Diagnostics buttons in the plugin settings page?
- Is there any chance you are using NginX as your main web server? I know you have probably already answered that, but it is really important to make sure.
Cheers,
TakisTakis, requested info below. I’ve confirmed with my host the server is indeed Apache.
––––––––––––––––
Debug:✔ PHP GD library is installed.
✖ Image cache directory has not been created.
But this is probably because the cache has not been accessed yet.
After accessing your website from a mobile device the directory should be automatically created./home/linweb02/t/thisisneil.com-1049804979/user/htdocs/wordpress/wp-content/cache => drwxr-xr-x
✔ Installation .htaccess file is setup OK.
/home/linweb02/t/thisisneil.com-1049804979/user/htdocs/.htaccess => -rw—-r–
❖ Adaptive images settings dump:
array(12) {
[“resolutions”]=>
array(4) {
[0]=>
int(1280)
[1]=>
int(1024)
[2]=>
int(640)
[3]=>
int(480)
}
[“hidpi”]=>
bool(true)
[“cdn-support”]=>
bool(true)
[“cache-directory”]=>
string(21) “cache/adaptive-images”
[“watched-directories”]=>
array(2) {
[0]=>
string(29) “/wordpress/wp-content/uploads”
[1]=>
string(28) “/wordpress/wp-content/themes”
}
[“jpeg-quality”]=>
int(60)
[“sharpen-images”]=>
bool(true)
[“watch-cache”]=>
bool(true)
[“browser-cache”]=>
float(180)
[“landscape”]=>
bool(false)
[“version”]=>
string(6) “0.6.61”
[“sanitized”]=>
bool(true)
}––––––––––––––––
Diagnostics:System information
Web Server
Apache
Document Root
/home/linweb02/t/thisisneil.com-1049804979/user/htdocs
PHP
5.6.24
PHP Time Limit
60
PHP Memory Limit
268435456
PHP Post Max Size
20M
PHP Upload Max Size
20M
PHP Max Input Vars
9999
PHP Display Errors
No
PHP Error Log
MySQL
5.6.35-log
MySQL Ext/mysqli
Yes
MySQL Table Prefix
wp_
MySQL DB Charset
utf8
WP
4.7.3
WP Multisite
No
WP Debug Mode
No
WP Site url
http://www.thisisneil.com/wordpress
WP WP Home url
http://www.thisisneil.com
WP Permalinks
/%year%/%monthnum%/%day%/%postname%/
WP home path
/home/linweb02/t/thisisneil.com-1049804979/user/htdocs/
WP content dir
/home/linweb02/t/thisisneil.com-1049804979/user/htdocs/wordpress/wp-content
WP plugin dir
/home/linweb02/t/thisisneil.com-1049804979/user/htdocs/wordpress/wp-content/plugins
WP content url
http://www.thisisneil.com/wordpress/wp-content
WP plugin url
http://www.thisisneil.com/wordpress/wp-content/plugins
WP Locale
en_GB
WP Memory Limit
40M
WP Max Upload Size
20mb
WP Active plugins
Adaptive Images for WordPress v.0.6.61 by Nevma
All In One SEO Pack v.2.3.12 by Michael Torbert
BackWPup v.3.3.7 by Inpsyde GmbH
Google XML Sitemaps v.4.0.8 by Arne Brachhold
Master Slider v.2.9.5 by averta
Page Specific Menu Items v.1.6.5 by Dharma Poudel (@rogercomred)
WP-Optimize v.2.1.1 by David Anderson, Ruhani Rabin, Team Updraft
WP Super Cache v.1.4.9 by Automattic
WP MU pluginsThank you.
N.Hello, again, and thank you very much for your patience and for the information you are sharing with me.
However, all the settings still seem correct, but the plugin is not working. It seems that the requests for images are not even reaching our plugin after all. It seems really baffling!
May I ask why you have the CDN support option enabled?
Also, if you check the HTTP headers that your server replies, you will see that it reports NginX as the
Servervariable: http://prntscr.com/ejjrn3/. Is there something about your setup that we might have misunderstood here?Cheers,
TakisHello Takis,
I’ve been in contact with my hosting provider this morning, they have assured me again that my server is Apache, though like you, I now see the images are supposedly served NginX… They’re now testing themselves and will get back to me within 24hrs. They have suggested the problem may be caused by a shared server. I’ll respond with results shortly.
Thanks for your time.
N.No problem there, I will wait for your results.
Cheers,
TakisHello Takis,
Here are the error logs from the server, however, there are no significant results.
[Fri Mar 10 05:55:28 2017] [error] [client 207.46.13.127] Premature end of script headers: php56-cgi
[Fri Mar 10 06:13:38 2017] [warn] mod_fcgid: read data timeout in 60 seconds
[Fri Mar 10 06:13:38 2017] [error] [client 85.241.199.171] Premature end of script headers: php56-cgi
[Fri Mar 10 06:14:10 2017] [warn] mod_fcgid: read data timeout in 60 seconds
[Tue Mar 14 23:49:06 2017] [warn] mod_fcgid: stderr: PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data’ to ‘-1’ in php.ini and use the php://input stream instead. in Unknown on line 0
[Wed Mar 15 05:11:20 2017] [warn] mod_fcgid: stderr: PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data’ to ‘-1’ in php.ini and use the php://input stream instead. in Unknown on line 0My hosts have simply suggested that my wordpress installation (Custom _s build) is not copatible with Adaptive Images. They have suggested installing the plugin via FTP.
Thanks.
N.Hello, again, my friend,
Well, these error logs really do not say much and there is no way of knowing whether they are even related to our plugin at all!
Now, what we know is that the host claims that they are using Apache, but the HTTP headers report NginX. I cannot make much of that, until we can be 100% sure.
As far as the Adaptive Images compatibility is concerned, I can only say that -on a technical level- the plugin has been tested on Apache and NginX and for PHP versions 5-7. Also there have been no reports of incompatibilities by users so far. This should not come as a surprise though, because the plugin is merely using the WordPress API and the common PHP GD Image library.
All in all, I am quite certain that your problem has to do with your setup. It is not a problem per se. Just a setup that we cannot support easily and whose details we are not even sure of. My best guess would be that your host is indeed using Apache as the original server, but they are using NginX as a caching server in front of it.
If that is indeed the case, then this would explain a lot of things. In this case the NginX server is acting something like a small scale CDN. Now, unfortunately our support for CDNs is still experimental due to the way that CDNs work: they completely bypass your website, in order to take the traffic load off of it, but this way they do not allow us to do much image handling as we intend to. You can try the CDN support option in the plugin settings page if you wish and test this out.
Let me know if there is anything more I can do to help.
Cheers,
TakisTakis, thanks again for your support. Much appreciated. I’ll keep an eye on future developments and let you know if I resolve the issue.
N.
You are very welcome!
The topic ‘Troubleshooting: 0 cache’ is closed to new replies.