Cache issue because of session_start()
-
As discussed and confirmed by the support of Tickera, this line is causing EVERY page of your site being set to no-cache. https://gist.github.com/mircobabini/a1c40524a8e160f68345fddb6f97ab19#file-tickera-class-session-php-L69
This is not ideal when having high traffic websites and so on. Then, the proper fix would be something like:
if(session_status() === PHP_SESSION_NONE && !headers_sent()) { session_cache_limiter('public'); session_start(); header("Cache-Control: s-maxage=604800, public, max-age=604800"); }
Btw: Tickera won’t fix this issue. They suggest a different solution:
add_filter('wp_headers', function ( $headers ) { $headers['Cache-Control']="s-maxage=604800, public, max-age=604800"; return $headers; });
This is just crazy if you ask me. A plugin should NEVER conflict with cache systems and suggest a workaround. The cache MUST work out of the box. If this is the general quality of the plugins in the WordPress ecosystem, this is why WordPress is always tagged as a slow and bloated amount of spaghetti code.
I really don’t think this is a solution. At all.
- The topic ‘Cache issue because of session_start()’ is closed to new replies.