Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,943 questions

51,883 answers

573 users

How to get or set the current cache limiter in PHP

2 Answers

0 votes
// string session_cache_limiter([ string $cache_limiter ] )

// The cache limiter defines which cache control HTTP headers are sent to the client.
// Setting the cache limiter to 'nocache' disallows any client/proxy caching. 


session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

echo "cache limiter is $cache_limiter<br />";

// set the cache expire to 10 minutes
session_cache_expire(10);
$cache_expire = session_cache_expire();

session_start();

echo "cache session pages expire after $cache_expire minutes";


/*
run:
    
cache limiter is private
cache session pages expire after 10 minutes 
       
*/

 



answered Jul 17, 2016 by avibootz
0 votes
// string session_cache_limiter([ string $cache_limiter ] )

// The cache limiter defines which cache control HTTP headers are sent to the client.
// Expire header is never sent to the client in this mode.


session_cache_limiter('private_no_expire');
$cache_limiter = session_cache_limiter();

echo "cache limiter is $cache_limiter<br />";



/*
run:
    
cache limiter is private_no_expire
       
*/

 



answered Jul 17, 2016 by avibootz

Related questions

1 answer 198 views
198 views asked Jul 17, 2016 by avibootz
1 answer 197 views
197 views asked Jul 16, 2016 by avibootz
1 answer 162 views
162 views asked Jul 16, 2016 by avibootz
1 answer 194 views
3 answers 251 views
...