Support Forum

Gravatar Cache not working

TR Timothy Ridgway
Timothy Ridgway
Member

Hi,

I’ve just installed the gravatar cache plugin, but it actually removes the gravatars from the site. Without the plugin the gravatars work fine.

I can see that the plugin IS saving a gravatar into the cache directory, but it saves them without any image extension (i.e. without the .jpg part of the name). If I download a cached file and add the extension then I see that the file is fine.

The problem is that the html for the gravatars is as follows which does NOT work:

<img class=”spAvatar” width=”50″ alt=”” style=”max-width: 50px” src=”/wp-content/sp-resources/forum-gravatar-cache/19b3138536875447fcf95fffa5d44a17″>

The filename needs  the .jpg extension to be recognised by a browser.

Is this broken for everyone or just me???

 

 

5 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

That is not how it works. The file it saves is a byte stream of the image – it needs no extension. HTML copes with this just fine – witness here where we have the cache turned on.

So – the real issue ios why will it not display anything. I am not aware of any server or browser settings that could effect this and no – we have no other such reports.

What about caching? Do you have any caching plugins active?

TR Timothy Ridgway
Timothy Ridgway
Member

Hi Mr. Swordfish,

When I cut and paste the URL from the cached images on THIS forum, I get an stream of image data returned. When I do the same thing on our site, the browser appends a slash “/” to the end and then says 404 error.

So this feels like maybe an .htaccess difference?

Thoughts?

YS Yellow Swordfish
Yellow Swordfish
Member

Yes – that would be different. That does suggest you have something interfering with URLs that should not be. Could be .htaccess I guess but more likely to be another WP plugin that is filtering the page text before it is sent to the browser… Ring any bells?

TR Timothy Ridgway
Timothy Ridgway
Member

Hi,

turns out it WAS the .htaccess file – there was the following section (added, I don’t know when, but I suspect to fix an SSH issue a long time ago!)

<IfModule mod_rewrite.c>
 RewriteCond %{REQUEST_URI} /+[^.]+$
 RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
</IfModule>

Anyway, I commented that out and now the gravatar cache works a dream. Only request would be in the future to get it to look at w3_total_cache CDN settings, and to call the image from the CDN if it is enabled. Just a small thought though.

Thank you so much for your help.