Latest News
Đẩy log exception của spring boot lên elasticsearch
  • About
  • EmEditor
  • Register Google Adsense

Love Coding

Note anything I want

  • Home
  • Web Development
    • HTML
    • Javascript
    • jQuery
    • CSS
    • PHP
    • ASP
    • JSP
    • Fix Bug
  • Other Development
    • Desktop Java
    • Mobile J2ME
    • VBS
  • Operating System
    • Windows
    • Linux
  • Database
    • MySQL
    • Oracle
  • Software
Home » Love Coding: Symfony Configure Caching

Symfony Configure Caching

HuyPV
Add Comment
Thursday, August 12, 2010
Cache action

Cache partial
- Trang có phần liên tục động kiểu như User đang online => Ko được thiết lập cache mà with_layout: true
- Trang đọc chi tiết tin bài
    + Cache: article/show
- Trang in chi tiết tin bài không có gì động nên cache toàn trang luôn (with_layout: true)
    + Cache: modules/article/config/cache.yml
    showPrint
         enabled: true
      lifetime: 86400
      with_layout: true
- Trong category/index có include component category/_listRecentArticles
index:
  enabled: true
  lifetime: 86400
Nếu enabled của index là true rồi thì cấu hình dưới đây có giá trị là gì cũng chả có ý nghĩa! Hiểu nôm na nếu cấu hình cache true cho cái bao trùm rồi thì mặc nhiên cái con nằm trong là bị cache?

_listRecentArticles:
  enabled: true
  lifetime: 86400


You can also work the other way around: enable the cache globally and then, disable it on specific pages that cannot be cached. It depends on which represents the less work for your application.

[*] Có thể bật cache cùng debug để kiểm tra kết quả cache, phần cache được sẽ có màu vàng!

Khi cache có thể gặp vấn đề với culture (mulitple language - hỗ trợ đa ngôn ngữ), tham khảo thêm ở đây http://meh.get-it.us/2010/07/14/language-conditional-caching-in-symfony/
Tweet
Symfony Configure Caching Title: Symfony Configure Caching
Description: Cache action Cache partial - Trang có phần liên tục động kiểu như User đang online => Ko được thiết lập cache mà with_layout: true... ...
Rating: 4

No comments :

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments ( Atom )
Quảng cáo

Popular Posts

  • VBS - Upload file HTTP Post
    Source: http://www.ericphelps.com/scripting/samples/Reference/Web/HTTP_POST.txt   Sub Upload(strUploadUrl, strFilePath, strFileField, strD...
  • Add other collapse div to your forum
    Collapse <div style="height: 16px; padding-right: 4px; font-weight: bold;" class="blockhead"> <span style=...
  • Use the YouTube API with PHP
    Process and integrate data from YouTube into your PHP application with PHP's SimpleXML extension Summary:   The YouTube vide...
  • Check Laravel version
    Đối tác bảo đang code và dùng Laravel, giờ muốn biết version Laravel tương ứng là bao nhiêu để xem mà code theo. Làm sao check? Cách 1: Sử...
  • Trong laravel thì queue:work với queue:listen khác nhau thế nào?
    Trong laravel thì queue:work với queue:listen đều chạy jobs trong queue. Vậy 2 cái này cũng phải có gì đó khác nhau chứ, nếu ko thì nó là ...
  • Hàm chuyển từ ngày dương lịch sang âm lịch (PHP)
    <?php function INT($d) {     return floor($d); } function jdFromDate($dd, $mm, $yy) {     $a = INT((14 - $mm) / 12);     $y = $yy + 4800 ...
  • Character Set và Collation trong MySQL là gì? Tạo DB thì để UTF8_GENERAL_CI hay UTF8_BIN
    Character Set là một tập các ký tự và dạng số hóa của các ký tự đó Collation là một tập các luật để so sánh các xâu được sinh ra từ các ký ...
  • git checkout file from other branch
    Đang làm trên nhánh dev. Muốn lấy 1 file, ví dụ: xxx/helper.php ở trên nhánh master về dev thì làm thế nào? Cách 1: nông dân nhiều bước nh...
  • mysql_error: Undeclared variable: INF
    mysql_error: Undeclared variable: INF PHP Code: $limit = 10; $page = isset($_GET['p']) ? $_GET['p'] : 1; $offset = ($pa...
  • Download media files (video, audio) from VnExpress.Net
    Download media files (video, audio) from VnExpress.Net Example: http://vnexpress.net/GL/Vi-tinh/Giai-tri/2010/02/3BA18A0E/page_4.asp htt...
Back to top!
Copyright 2010 Love Coding - All Rights Reserved Design by Newbie_PC - Powered by Blogger