[pmwiki-users] Pagelist using random argument : needed to disallow IMS caching

Petko Yotov 5ko at 5ko.fr
Mon Dec 12 22:17:02 PST 2022


Your observation is correct.

When $EnableIMSCaching is set, PmWiki sends the browser the last 
modified timestamp of the file wiki.d/.lastmod (which is updated every 
time a page is saved) and instructions to allow the browser to cache the 
response.

Next time the browser sends the header "if-modified-since" with the same 
timestamp, PmWiki only sends a response "Not modified, re-show cached 
page".

To prevent this, indeed you can set $EnableIMSCaching = 0; in 
local/Group.Page.php.

Alternatively, you can use a different URL to the page with an argument 
that is ignored by PmWiki, but for the browser it will appear a 
different page, so it will not send the "if-modified-since" header. 
Something like this:

   [[{*$FullName}?st={(ftime %s)} | Refresh current page ]]

I have no idea if this will work with caching recipes like FastCache.

Petko

On 13/12/2022 05:30, ABClf wrote:
> Hello,
> 
> For a pagelist showing 10 articles, randomly chosen (order=random), I
> have had to disallow IMScaching setting (for the page only) ; if not,
> refreshing the page would print out the same result every time it is
> refreshed (that means that only the first access would have given the
> expected result : in this case, I wanted to let the user to be given
> 10 more randomized articles every time he refreshes the page).
> 
> I first tried ?action=browse to force a refresh as well as pagelist
> argument cache=0, with no success. Finally, disallowing IMScaching
> seems to be the right step.
> 
> My question is : am I right, is that the regular behaviour ?
> 
> Thank you,
> Gilles.
> 



More information about the pmwiki-users mailing list