Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Gravatar Cache not working
Avatar
Timothy Ridgway
Rookie
Free Members
sp_UserOfflineSmall Offline
Feb 3, 2014 - 7:47 am

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???

 

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 3, 2014 - 8:44 am

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?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Timothy Ridgway
Rookie
Free Members
sp_UserOfflineSmall Offline
Feb 3, 2014 - 8:56 am

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?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 3, 2014 - 9:07 am

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?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Timothy Ridgway
Rookie
Free Members
sp_UserOfflineSmall Offline
Feb 3, 2014 - 9:58 am

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.

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 3, 2014 - 10:32 am

Excellent find.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625