4 ms·
It's nice, but people love to see the number of current likes. For one of my customers, I created a Facebook like area [0](visible on the bottom of the site) t
by NKCSS 10y ago
It's nice, but people love to see the number of current likes.
For one of my customers, I created a Facebook like area [0](visible on the bottom of the site) that shows the amount of likes. All required data is retrieved server-side and cached; to not expose end-users to Facebook tracking while still providing images and like count.
[0]: https://www.bakkerij-emmerix.be/be https://www.bakkerij-emmerix.be/be
It uses the user-supplied images by facebook (square and banner) with the option to supply a larger-version than Facebook returns.
It's not rocket science, but it makes the site load a lot faster and does not expose the user to tracking.
- nothrabannosir 10y ago> and does not expose the user to tracking. Thanks for taking the time. :)
- LukeShu 10y agoOut of curiosity, how do you do the caching? How long is the cache valid for? Is it only triggered by a user request, or is it updated by a cron job or similar?
- NKCSS 10y agoWebsite was written in C# (ASP.NET MVC); the data is cached in-memory on the webserver. I have caching limit (Like Count = 3 minutes, Page info (name, images, etc.) = 1 hour). Every time one of the resources is requested from the webserver; it's served from memory (initial retrieval on site start); and on access, it's checked how old the data is. If the data's older than the threshold, it's refreshed async and displayed on the next request.