Results 1 to 4 of 4

Thread: Cache timeout

  1. #1
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Cache timeout

    Could someone briefly explain to me the "Set cache timeout" option that can be set for each page? What exactly does this, and does it relate to the Cache that's within Contao (I believe there is something like this) or the browser cache? How do I work out what to set this to?

    Many thanks!

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    In Settings you can set "Bypass the internal cache", this is a cache for contao to run faster. You can see cached files on Maintenance "Purge the internal cache".

    Cache for visitors:
    In Settings you should set the cache mode to "use only the server cache" to ensure that your visitors always get the actual pages. But only pages with a cache time set will get cached. If you set a cache time for a page i.e. the "Website root" this settings gets inherited to subpages. Cached pages are stored in system/html/. Contaos page caching is not ment for simulating a static website. It is build to handle heavy server loads. So set it to a short time if you have many visitors.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  3. #3
    User
    Join Date
    06-19-09.
    Posts
    106

    Default

    Thank you for your reply. I'd like to clarify:

    The 'cache timeout' that I can set for each page, does this mean that the cache is being deleted and re-built after this amount of time? I don't quite understand why a shorter time would be better if the site has a lot of visitors.

    Also, if an item gets changed in Contao – e.g. a piece of content, a file, or CSS – is the cache updated immediately with this change?

  4. #4
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    Quote Originally Posted by spirelli View Post
    The 'cache timeout' that I can set for each page, does this mean that the cache is being deleted and re-built after this amount of time?
    Before Contao delivers a page it searches for an actual cached page. If cache time is set to 1 min and it finds a cached page, that isn't older than 1 min, this one gets delivered, else a new cached page version gets gernerated. If there are i.e. 100 page request within one min, the cached page gets delivered which is better as to build up this page a hundred times. After this minute a new version gets generated.

    Quote Originally Posted by spirelli View Post
    I don't quite understand why a shorter time would be better if the site has a lot of visitors.
    Look above and there's a discussion on github (starts in german, further down in english). https://github.com/contao/core/issues/7155

    Quote Originally Posted by spirelli View Post
    Also, if an item gets changed in Contao – e.g. a piece of content, a file, or CSS – is the cache updated immediately with this change?
    I don't think so but don't know exactly. Leo Feyer recommends to not try to simulate a static website because a CMS provides dynamic content. Just to use it for handling heavy loads.

    ps When you're are logged into back end, pages will not get cached.
    Last edited by Andreas; 10/22/2014 at 02:02.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •