Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu Cache? #83

Open
piperone opened this issue Mar 3, 2016 · 1 comment
Open

Menu Cache? #83

piperone opened this issue Mar 3, 2016 · 1 comment

Comments

@piperone
Copy link

piperone commented Mar 3, 2016

Do you have any suggestions with regards to handling caching a menu with this package? I recently had to move away from the "file-based" way of adding menuitems and put them inside a DB instead. Now I'd like to eliminate the extra queries and, if possible, the menu-building process for each request instead. My menu doesn't change that often anyway so, cacheing seems like a good idea to me.

I tried the most straightforward approach first:

$myMenu = Cache::remember('menu', $minutes, function(){
    return Menu::make('myMenu', function(){
        //
    });
})

But this results in:

Exception in FileStore.php line 100:
Serialization of 'Closure' is not allowed

Is there a good way to achieve this, or something similar?

@piperone
Copy link
Author

No suggestions at all for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant