Saturday, June 20, 2015

apache 2.2 - mod_pagespeed not inserting image dimensions




I've added the following:



ModPagespeed on
ModPagespeedEnableFilters insert_image_dimensions


However, my image still appears as follows:



WordPress



No width has been inserted here.



(Page URL https://www.medexpress.co.uk/journals/readme.html)


Answer



It looks like image dimensions are not being inserted because mod_pagespeed is unable to fetch your images. mod_pagespeed must be able to fetch the image in order to know how large they are to be able to insert the correct dimensions. There are a number of reasons that fetching can fail. See the bullet list at the bottom of this FAQ for some of the most common reasons.



The best solution to the problem though, if your environment allows it, is to enable ModPagespeedLoadFromFile. This allows mod_pagespeed to fetch files directly from disk, instead of over HTTP, which can increase reliability and performance.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...