Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/e66d199a5de6f827#

I've came across one issue, when using Memory Caching in 5.1.0 version of
In-Portal.

For example:   -

  • there are 2 developers

...

  • each developer uses it's own copy of in-portal code

...

  • both developers connect to the same database

When all cache was stored in database, then 2nd developer will immediately
have immediately have changed, that 1st developer have cached. For example, when 1st
developer 1st developer adds new menu item on Front-End, then 2nd developer will see it
immediatelyit immediately, since it's cached to "cms_menu" cache. 

In memory caching implementation we have protection against case, when 2
websites on In-Portal will use common cache instead of separate. This
protection has side effect, that 1st and 2nd developers now will have own
cache versions and 2nd developer will have to rebuild cache to see, what 1st
developer have placed into it (since cache is build based on common database
in my example).

This all happens because of each memory cache key has prefix based on
In-Portal installation folder full path (FULL_PATH constant), which is
different for both developers. If we will replace it with relative In-Portal
installation folder (BASE_PATH constant), then it will do us no good, since
it will be "/" for most of the sites and as a result will mix up caches of 2
separate In-Portal installations on same server.

I really don't know if this is a bug or a feature, since database is shared,
but cached data isn't.

I suddenly got idea, how to fix that:
Here is problematic line *$site_key = 'site_serial:' . crc32(FULL_PATH);* of
* of kCache::_cachePrefix* method method. We can do 2 things here:   1.

  1. move it to new class attribute, so we don't have to calculate crc32

...

  1. for each stored/retrieved key + replace $site_key with that attribute usage;

...

  1. use BASE_PATH constant instead of FULL_PATH, when we have

...

  1. *$_CONFIG['Misc']['Mode]

...

  1. = 'development';* (new config variable) set in config.php file.

Related Tasks

Jira Legacy
serverSystem Jira
serverId513b375f-8291-

Best Regards,
http://www.in-portal.com
http://www.alex-time.com
3313-9d9f-704c39b1f915
keyINP-707