PHPerKaigi2020での発表資料です(※配布用に改訂しています) https://fortee.jp/phperkaigi-2020/proposal/ef0682ab-08b3-4129-ac1f-41b22c40021a
久々登場、みなさんこんにちは nakamura です。今年こそはベイスターズの優勝を信じて疑いません!ぼちぼちマジック点灯しちゃいますよ! さてさて今日は CakePHP のちょっとだけ深いお話し。キャッシュの保存先に memcached を使っている場合の問題と対処法についてです。 CakePHP を使っているとどうしてもキャッシュをクリアしたい場面が出てくると思いますが、そんな時みなさんはどうしていますか?ファイルにキャッシュしているのであれば直接削除する人が多いでしょうか 。memcached の場合はどうでしょう?Cake の Cache クラスには clear というメソッドがあるのでこれを使ってシェルを書くのが良いかもしれません。もしくはちょっと乱暴ですが、memcached を再起動しちゃうなんてのもあるかもですね。 大抵の場合これで問題はなさそうですが、実はキャッシュの保存
色々と訳合って、CakePHPをやることになりそう。LAMP環境は整っているので、あとはCakePHPを用意しておく。 http://cakephp.jp/ CakePHPのサイトから落として解凍して、DocumentRoot直下にcakephpというディレクトリ名で移動して準備完了。 CakePHPのマニュアルの3.2.2に CakePHP は、幾つかの操作のために/app/tmpディレクトリを使用します。モデルのdescriptionや、ビューのキャッシュ、セッション情報などです。 なので、Cakeのインストール時には、/app/tmpディレクトリに書き込み権限があることを確認してください。との記述を見つけたので、app/tmp以下に書き込み権限を追加しておく。 で、ブラウザからcakephpにアクセスしてみると、 Forbidden You don't have permission
PHPフレームワークの速度比較では、HelloWorldを表示するのみの単純なアプリを用いた計測を元に比較表が作られることが多いです。特に後発のフレームワークは分かりやすい特徴付けとして速度をアピールする傾向にあるため、その比較表を元に N倍速いというアピールをしています。 PHPフレームワークを使うということは、DBまで絡めたWebアプリを作ることがほとんどなため、HelloWorldアプリの比較よりは、DBからレコード取得して表示するまでの処理速度を比較したほうがより現実に近い指標になると思います。特にCakePHP1系ではDBのデータ取得も独自ドライバになっていますし、モデルの処理も重いのでそこまで含めて他と比較したほうが良いと思ってます。 今回はDBから1レコード取得して表示するという簡単なアプリで各フレームワークの速度を評価しました。フレームワークに備わっているViewキャッシュ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く