Facebook sharer and prerender.io (in an angularjs app)
Asked Answered
H

1

8

I've just setup prerender.io middlewave into my tomcat server (running some java webservices and an angularjs app).

The service (prerender) works as it should and I can see the pages adding to the list (also when I send a request simulation the user agent).

My problem is with the Facebook share button (from addthis).

Basically if I visit a not yet cached page and click the "Share on Facebook" button, it will show me the angularjs template and not the "rendered" one.

The strange thing is that I then can see the page on Prerender.io admin.

It's like it's too slow and it times out. Still I don't know how it get the non-cached version of the page.

After the first wrong call Facebook caches the page so if I don't manually refresh it from the Facebook Object Debugger (https://developers.facebook.com/tools/debug/og/object) the wrong page will stay cached on FB servers until the FB cache is refreshed.

Anyway has any suggestion on how to fix this?

I could pre-cache every page but I will have to deal with new pages and I don't think it's a nice solution.

thanks, Dem

Horsy answered 13/6, 2014 at 2:57 Comment(1)
Hey! Did you figure this out? I can't even get prerender to list my cashed pages. What did you use as crawlerUserAgents for Facebook? Here is my question, do you mind having a look at it? #26013975Boschvark
H
1

I have the same issue and it still bothers me a lot.

What you can do is after you create your page (typically your user save something), then you can create a server call to prerender to recache your page. After some time (for example 1 min) you can invoke an another call to facebook to refresh its cache...

The only issue with this, it works only after couple of minutes... :(

Homegrown answered 11/6, 2015 at 16:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.