YOU CAN EDIT THIS PAGE! Just click any blue "Edit" link and start writing!

Tech:NumberOfArticles acting up

From Wikitravel Shared
Jump to: navigation, search

Moved from en:Wikitravel:Bug reports 1.4.x-1.5.x/Fixed by Evan

The special counter {{NUMBEROFARTICLES}} is acting up. For instance, on the Swedish Wikitravel, the special en::sv:Wikitravel:NumberOfArticles says "34", the Main Page says "36" and en::sv:Special:Statistics says "37". What gives? These are from copies downloaded by wget, so it's not a local caching issue. Jpatokal 21:16, 6 Jan 2005 (EST)

No, it's a server-side caching issue. I'll try to look into it. --Evan 22:00, 6 Jan 2005 (EST)
Still flaky. See eg. [1], which reports 466 instead of the current 473. Jpatokal 04:22, 4 Mar 2005 (EST)
I suggest for your script that, instead of reading , which can and probably is an out-of-date cached version, you read , which is regenerated each time. In addition, this will overwrite the cached version, so we get the best of both worlds.
For those of a technical bent, here's the explanation: we cache HTML on the server. When a page is modified (added/edited/deleted), the cached HTML is deleted, and regenerated when someone asks for the page again. In addition, any pages that depend on that page are removed from the cache, too. Our problem is that pages that contain site-wide statistics (like number-of-articles) depend on all other pages. I need to add a check to invalidate their cache entries whenever there's any modification to the site. --Evan 09:40, 11 Mar 2005 (EST)
The workaround of using index.php works like a charm (yay!). Jpatokal 22:30, 17 Mar 2005 (EST)