Welcome Guest, Not a member yet? Register   Sign In
Enable Browser Caching in Codeigniter 3
#2

I think I found a solution for the problem. In my header view I changed the HTML meta tag to a call to the PHP function header(). It now looks this way.


Code:
<head>
    <?php header("Cache-Control: public, max-age=60, s-maxage=60");?>
    ...
</head>


The response header now seems to get the correct values: "Cache-Control    public, max-age=60, s-maxage=60".

I think there might be some change in the CI framework code from CI 2 to CI 3. In CI 2 there was no Cache-Control entry in the response header whether the default option of CI 3 seems to be "no-store, no-cache, must-revalidate".
Reply


Messages In This Thread
[SOLVED] Enable Browser Caching in Codeigniter 3 - by StevePINA - 08-23-2016, 02:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB