Hi,
I found caching issue in K2 item view (K2 2.10.3, Joomla 3.9.28).
In com_k2/views/item/view.html.php is called function
JResponse::allowCache(true);
This causes that Expires header is set to response by Joomla 15 minutes in future, regardless caching is enabled or not. What it cause is if user is logged in, opens some K2 article, then log out, and display the article again, the whole page is still displayed as he is logged in (browser takes it from disk cache, not from server). An opposite, user is not loggedn in, displays an article (which is for example just for logged in users), login then, go back to article, and page is still disaplyed as he is not logged in.
Moreover, when cache is enabled in Joomla global configuration System K2 plugin adds expiration header just for guests. This solves issue Logged in -> logout, but opposite still remains. So when user is not loggedn in, then login, he still sees wrong page, as he is not logged in.
There is 'x-logged-in' header, however this seems to work only when Varnish cache is installed on server.
I didn't find way, how to disable this behavior, without hacking K2. Is this known issue, or am I doing something wrong?
thanks
Pavel
I found caching issue in K2 item view (K2 2.10.3, Joomla 3.9.28).
In com_k2/views/item/view.html.php is called function
JResponse::allowCache(true);
This causes that Expires header is set to response by Joomla 15 minutes in future, regardless caching is enabled or not. What it cause is if user is logged in, opens some K2 article, then log out, and display the article again, the whole page is still displayed as he is logged in (browser takes it from disk cache, not from server). An opposite, user is not loggedn in, displays an article (which is for example just for logged in users), login then, go back to article, and page is still disaplyed as he is not logged in.
Moreover, when cache is enabled in Joomla global configuration System K2 plugin adds expiration header just for guests. This solves issue Logged in -> logout, but opposite still remains. So when user is not loggedn in, then login, he still sees wrong page, as he is not logged in.
There is 'x-logged-in' header, however this seems to work only when Varnish cache is installed on server.
I didn't find way, how to disable this behavior, without hacking K2. Is this known issue, or am I doing something wrong?
thanks
Pavel
Edited 5 years 3 months ago by Pavel Poles · Reason: Invalid code rendering