ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


Cache is not working


  • 2009-09-02 00:42:48

    Cache is not working

    Hi All,
    I am trying to cache the terms, for that I have enabled the cache but it is not caching.

    If I enable the cache debug it is printing -
    Debug: 61: $cache_absfile ->
    Debug: 72: $cache_absfile ->
    Debug: 187: $cache_absfile ->
    Debug: Not caching, CACHE_ON is off
    Debug: 123: Adding _cache_template to the variable store
    Debug: 279: $cache_absfile ->
    Debug: Not caching, CACHE_ON is off

    If I change the CACHE_ON 1 or 0 it is displaying the same thing -
    i.e:-
    Debug: 61: $cache_absfile ->
    Debug: 72: $cache_absfile ->
    Debug: 187: $cache_absfile ->
    Debug: Not caching, CACHE_ON is off
    Debug: 123: Adding _cache_template to the variable store
    Debug: 279: $cache_absfile ->
    Debug: Not caching, CACHE_ON is off

    And if I see in the mysql log file always it is firing one sql query as shown below -
    SELECT L.* FROM at_language_text L, at_language_pages P WHERE L.language_code='en' AND L.variable<>'_msgs' AND L.term=P.term AND P.page='/login.php' ORDER BY L.variable ASC

    I don't want this query to be firing for every page.

    Can any body tell me how to enable the caching to stop firing this sql query?


    Things to describe:
    Operating system ATutor is installed on - Windows XP
    ATutor version - 1.6.3
    ATutor theme name - Default
    PHP version - 5.2.6
    MySQL version - 5.1
    Webserver & version - Apache 2.2.9
    Web browser being used - IE6 and above, Mozilla Firefox, Chrome and Safari

  • 2009-09-02 01:49:17

    Re: Cache is not working

    Do you have a path to cache dir specified in system properties?

  • 2009-09-02 02:53:30

    Re: Cache is not working

    No.
    If I set CACHE_DIR, here it will disable caching.

    [php]
    if (defined('CACHE_DIR') && (CACHE_DIR != '')) {
    define('CACHE_ON', 1); /* disable caching */
    } else {
    define('CACHE_ON', 0); /* enable caching */
    }
    if (!defined('CACHE_DIR')) {
    define('CACHE_DIR', '');
    }
    [/php]

  • 2009-09-02 02:56:05

    Re: Cache is not working

    Shall I need to specify cache dir in the _config table? how?

  • 2009-09-02 03:44:27

    Re: Cache is not working

    I believe that in the above code snippet the comments are wrong (they should've been just swapped). So it should work.

  • 2009-09-02 05:31:22

    Re: Cache is not working

    Thank you IndieRect for your response.

    Can you tell me where to specify cache dir?

  • 2009-09-02 07:48:10

    Re: Cache is not working

    You should log in as an admin and go to System Preferences tab. The field in question is Cache Directory.
    Please have a look at the ATutor Handbook on that page for directions on what to put there.

  • 2009-09-02 09:15:44

    Re: Cache is not working

    Thank you IndieRect. It works fine.

    The confusion was if I specify cache dir name it is going to disable caching. So I didn't specified cache dir.


    I wanted know what is the mechanism being used for caching? What is the format of the cache file?

  • 2009-09-02 09:19:37

    Re: Cache is not working

    Hi Greg,
    Can you please ask them to change these comments in the next release.
    [b]Original[/b]
    [php]
    if (defined('CACHE_DIR') && (CACHE_DIR != '')) {
    define('CACHE_ON', 1); /* disable caching */
    } else {
    define('CACHE_ON', 0); /* enable caching */
    }
    [/php]
    [b]To[/b]
    [php]
    if (defined('CACHE_DIR') && (CACHE_DIR != '')) {
    define('CACHE_ON', 1); /* enable caching */
    } else {
    define('CACHE_ON', 0); /* disable caching */
    }
    [/php]

    Thanks

  • 2009-09-02 09:35:21

    Re: Cache is not working

    You're welcome.

    The mechanism is all in the file include/phpCache/phpCache.inc.php, and the cache file format is, I believe, a serialized nested array.
    You can check phpCache.inc.php and docs for PHP serialize() function for more detail.

    [reply][b]In reply to:[/b]
    Thank you IndieRect. It works fine.

    The confusion was if I specify cache dir name it is going to disable caching. So I didn't specified cache dir.


    I wanted know what is the mechanism being us...
    [op]forums/view.php?fid=7;pid=18535;page=1#18548[/op][/reply]

  • 2009-09-02 11:33:09

    Re: Cache is not working

    The comment has now been adjusted, and will show up in the next release.

  • 2009-09-03 02:44:59

    Re: Cache is not working

    Thank you IndieRect for your information it was very useful.

    Thank you Greg for changing. It will be helpful for others.

    In the thread
    [quote]http://www.atutor.ca/view/7/1064/1.html[/quote]
    they have mentioned that it isn't recommended to enable caching. what is the disadvantage I get if enabled.
    And also I wanted to know what is database saturation, when do you say database is saturated.