Recently, I implemented prerender.io middleware on my Tomcat server, which is running Java webservices and an AngularJS app.
The prerender service is functioning correctly, and I can see the pages being added to the list when I send a request simulating the user agent.
However, I'm encountering an issue with the Facebook share button (from addthis).
When I visit a page that has not been cached yet and click the "Share on Facebook" button, it displays the AngularJS template instead of the "rendered" version.
What's perplexing is that I can see the page on the Prerender.io admin panel.
It seems like the rendering process is too slow and timing out, but I'm unsure why it's fetching the non-cached version of the page.
Once the first incorrect call is made, Facebook caches the page. If I don't manually refresh it using the Facebook Object Debugger (https://developers.facebook.com/tools/debug/og/object), the incorrect page remains cached on Facebook servers until their cache is refreshed.
Does anyone have any suggestions on how to resolve this issue?
I could pre-cache every page, but that would be cumbersome to manage for new pages. I'm hoping for a more elegant solution.
Thanks,
Dem