Jump to content
lunaraurora

double cache-control header response due to redis settings

Recommended Posts

Hello, i tested with a header checker the file asyncjs.php served from my subdomain - and it results in a twice header cache-control response: 

 

cache-control

private, max-age=3600, max-age=864000

I enabled Redis plugin and i found this portion of code inside the file apRedis.delivery.php:

        $result = $redis->setex($filename, $expire + 86400, $redis->serialize($cache_contents));

I believe is responsible for such double response.. i'm not a dev nor expert, could someone please suggest me how to fix it?

Many thanks

Share this post


Link to post
Share on other sites

no suggestions?

at the moment i just commented out this from file asyncjs.php:

// The browser is allowed to cache this
// if (!empty($conf['delivery']['assetClientCacheExpire'])) {
//     $expire = (int)$conf['delivery']['assetClientCacheExpire'];
//     header("Expire: ".gmdate('D, d M Y H:i:s \G\M\T', MAX_commonGetTimeNow() + $expire));
//     header("Cache-Control: private, max-age={$expire}");
// }

in way to get only the header directives of the redis plugin:

cache-control

max-age=864000

.. not sure if this is the best solution but fix the double header response

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...