ws420 edited a comment on issue #1681: Uncacheable content, preventing rewriting of image
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1681#issuecomment-593888538
I also had the problem with the infinite loop but ModPagespeedSupportNoScriptEnabled fixed
it. I also purged Cloudflare cache
Here's the settings in Cloudflare (dev mode)

in Plesk

Directives

htaccess
```
Modpagespeed On
ModPagespeedEnableFilters rewrite_css
ModPagespeedEnableFilters combine_css
ModPagespeedEnableFilters recompress_images
ModPagespeedEnableFilters convert_png_to_jpeg
ModPagespeedEnableFilters convert_jpeg_to_webp
#ModPagespeedEnableFilters convert_jpeg_to_progressive
ModPagespeedEnableFilters convert_to_webp_lossless
ModPagespeedEnableFilters recompress_webp
ModPagespeedEnableFilters lazyload_images
ModPagespeedEnableFilters collapse_whitespace
ModPagespeedEnableFilters remove_comments
ModPagespeedEnableFilters extend_cache
ModPagespeedEnableFilters make_google_analytics_async
ModPagespeedEnableFilters rewrite_javascript
# ModPagespeedEnableFilters combine_javascript
# ModPagespeedEnableFilters defer_javascript
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# Wordfence WAF
<Files ".user.ini">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</Files>
# END Wordfence WAF
<IfModule mod_expires.c>
ExpiresActive On
# Images
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
# Video
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/mpeg "access plus 1 year"
# CSS, JavaScript
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
# Others
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
# Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
</IfModule>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wp/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]
RewriteRule . index.php [L]
RewriteRule ^/sw.js$ <location>
```
I think there's something wrong with the htaccess so I commented out this part:
`# Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"`
Now the error is "4xx status code, preventing rewriting" and the website is broken because
images and other resources are returning 404 errors
At least I see some webp rewriting in the source code now, so we are making some progress!
Thanks for your help
Edit: I tried adding ModPagespeedFetchHttps enable but I get an Internal Server Error
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
|