I implemented a voting feature for articles on my Drupal 7 website. The problem is that the votes are somehow not updating on the website. I can see it updated only when I am logged in.
Can anybody help me?
I think you have simply some cache enabled. You should check the caching methods in charge for the website. Static content is cacheable. Content for logged in users are in most cases excluded from the caching rules because dynamic content can not be cached.
Caching serves a static version of the rendered code from the ram of your server. The content has been already rendered before. Thats why you will probably see some older version of the website.
It is possible to purge the cache for specific pages on specified events. You can check Drupal if there is a plugin available which purges the cache in case of voting happened. If thats not the case you can add few lines of code withing the voting plugin so that on the event of voting some cache purging for this page happens.
Yes thats true. Alternatively you can set a cache lifetime to 30min or even a shorter time period. In this case users will see the updates with some short elay. Many websites do it this way.
Logged in users will see the website in realtime as content for logged in users will be served generally not cached.
Please login or Register to submit your answer