I am not sure if this is a common problem. I use drupal 7 site with caching enabled. One of my pages is a simple poll. After anonymous voting, all cached pages are invalidated for current user. The cached pages remain in database so after clearing browser cache, current user sees cached pages again. Does poll use some sort of cookie that invalidates cache? How can I avoid such behavior? Thank you
2 Answers
After hours of testing, it looks like the Advanced Poll module does the job. Here is an excerpt about it from the module's project page:
... a replacement to Drupal's poll module and provides multiple voting systems, decision-making tools, and management options.
- Voting systems: Basic polls, Approval Voting, Borda Count, and Instant-Runoff Voting.
- Vote management: view each user's vote, delete all votes, or restrict the poll to a list of users.
- Time management: schedule when to open or close the poll, and choose when to show results.
- Choice management: write-in choices, and support for HTML (or other input filter).
- Usability: fast Ajax interaction and customizable default settings.
- Migration: convert regular Drupal polls into Advanced Polls.
Pages with functionality that need to change or request information from the database, in general can not be cached. Something like the Ajax Blocks module or a custom solution can help work around this. Here is an excerpt about it from that module's project page:
Permits to load some blocks by additional AJAX request after loading the whole cached page when the page is viewed by anonymous user. It is suitable for sites which are mostly static, and the page caching for anonymous users is a great benefit, but there are some pieces of information that have to be dynamic.