Jump to content

Question about $cache


Raymond Geerts
 Share

Recommended Posts

I was wondering what the best (fastest/lesses computing power) aproach in using PW API variables inside the $cache function call?

(not actual code)

Example 1

echo $cache->get("example-1", function($user,$page,$pages) {}

Example 2

echo $cache->get("example-2", function() use($user,$page,$pages) {}

Example 3

echo $cache->get("example-3", function() {
  $user = wire('user');
  $page = wire('page');
  $pages = wire('pages');
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...