dongyigua4468 2013-12-27 17:17
浏览 23
已采纳

使用laravel和php缓存或会话

I'm using laravel 4 to build an app. The user logs in with their FB account and the friendlist is loaded in an object. Currently I'm saving that object in a session so I can use it across the site. However I've been told that it's better to cache the object as a file client-side.

How would I go about storing something like that clientside? Perhaps as a json file? Is there perhaps anything built into Laravel 4 that does/helps with this?

Currently I simply do Session::set($friendlist) in laravel and then get it across pages.

I don't want to constantly query facebook since that's rather slow.

  • 写回答

1条回答 默认 最新

  • dongpanbo4727 2014-03-30 00:47
    关注

    Just saw this because I am looking to prevent the same problem. Laravel's caching is your friend. You can cache just about anything -- including FB responses. A nice overview is here: https://laracasts.com/lessons/caching-essentials

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 Macbookpro 连接热点正常上网,连接不了Wi-Fi。
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程