• Snowcovered.com

    Custom DNN Modules

Subject: SEO MENU 3.5.17 - Cache Bugs

You are not authorized to post a reply.   
Prev Next
Author Messages
fUser is Offline

Posts:4

12/13/2007 1:18 PM Alert 

Hello,

We are using SEO Menu 3.5.17 and we have identified some bugs.

1. When you have several users and several pages, cache cleaning eats up CPU for hours.

Here is the solution. edit SEOMenuSkinObject.ascx.vb and replace cmdClearCache_Click with the following: (this was tested on DNN 4.5.3)

            DataCache.RemoveCache("SEOMenuModuleSettings" & Me.ModuleId.ToString)
            DataCache.RemoveCache("SEOMenuSettings" & Me.ModuleId.ToString)
            DataCache.RemoveCache("SEOAdminSettings")
            DataCache.RemoveCache("SEOMenuSkinObjectSettings")
            '
            Try
                '
                Dim it As IDictionaryEnumerator = CachingProvider.Instance.GetEnumerator()
                While (it.MoveNext)
                    Dim key As String = it.Key.ToString
                    if (key.StartsWith("SEOAdminMenu") or key.StartsWith("SEOMenuSkinObjectMenu") or key.StartsWith("SEOMenuModuleMenu") or key.StartsWith("SEOMenuMenu"))
                        CachingProvider.Instance.Remove(key.ToString)
                    end if
                End While
                '
            Catch ex As Exception
                Response.Write(ex.Message)
                DotNetNuke.Services.Exceptions.LogException(ex)
            End Try
            '

2. Cache keys are ambiguous. For instance SEOMenuSkinObject.ascx.vb, line 219 reads:

    DataCache.SetCache(
           "SEOMenuSkinObjectMenu" &
                PortalSettings.ActiveTab.TabID.ToString &
                 username &
                 cinfo.CurrentCulture.Name.ToString
    , strSEOMenu, TimeSpan.FromMinutes(intCacheTimeout))

This is caching menu for a tabId, a Username and a Culturename. Imagine for a second we have 2 tabs with Ids 1 and 11 and 2 users 1 and 11. Cache content would be overriten and mixed when user 11 visits page 1 and when user 1 visits page 11. This is a bit unlikely, but not impossible.

Please fix.

fUser is Offline

Posts:4

12/13/2007 1:18 PM Alert 

Hello,

We are using SEO Menu 3.5.17 and we have identified some bugs.

1. When you have several users and several pages, cache cleaning eats up CPU for hours.

Here is the solution. edit SEOMenuSkinObject.ascx.vb and replace cmdClearCache_Click with the following: (this was tested on DNN 4.5.3)

            DataCache.RemoveCache("SEOMenuModuleSettings" & Me.ModuleId.ToString)
            DataCache.RemoveCache("SEOMenuSettings" & Me.ModuleId.ToString)
            DataCache.RemoveCache("SEOAdminSettings")
            DataCache.RemoveCache("SEOMenuSkinObjectSettings")
            '
            Try
                '
                Dim it As IDictionaryEnumerator = CachingProvider.Instance.GetEnumerator()
                While (it.MoveNext)
                    Dim key As String = it.Key.ToString
                    if (key.StartsWith("SEOAdminMenu") or key.StartsWith("SEOMenuSkinObjectMenu") or key.StartsWith("SEOMenuModuleMenu") or key.StartsWith("SEOMenuMenu"))
                        CachingProvider.Instance.Remove(key.ToString)
                    end if
                End While
                '
            Catch ex As Exception
                Response.Write(ex.Message)
                DotNetNuke.Services.Exceptions.LogException(ex)
            End Try
            '

2. Cache keys are ambiguous. For instance SEOMenuSkinObject.ascx.vb, line 219 reads:

    DataCache.SetCache(
           "SEOMenuSkinObjectMenu" &
                PortalSettings.ActiveTab.TabID.ToString &
                 username &
                 cinfo.CurrentCulture.Name.ToString
    , strSEOMenu, TimeSpan.FromMinutes(intCacheTimeout))

This is caching menu for a tabId, a Username and a Culturename. Imagine for a second we have 2 tabs with Ids 1 and 11 and 2 users 1 and 11. Cache content would be overriten and mixed when user 11 visits page 1 and when user 1 visits page 11. This is a bit unlikely, but not impossible.

Please fix.

fUser is Offline

Posts:4

12/13/2007 1:22 PM Alert 
Same issue happens (and are MUCH more likely to happen) for following cache keys:

"SEOAdminMenu" & objCache.TabID.ToString & Convert.ToString(cinfo.Name)

"SEOMenuSkinObjectMenu" & objCache.TabID.ToString & username & Convert.ToString(cinfo.Name)

"SEOMenuModuleMenu" & Me.ModuleId.ToString & objCache.TabID.ToString & username & Convert.ToString(cinfo.Name)

"SEOMenuMenu" & Me.ModuleId.ToString & objCache.TabID.ToString & username & Convert.ToString(cinfo.Name)


An easy solution would be for instance using characters that cannot happen in the values concatenated to separate ids. For instance:

"SEOMenuMenu" & Me.ModuleId.ToString & "\t" & objCache.TabID.ToString & "\t" & username & "\t" & Convert.ToString(cinfo.Name)
fUser is Offline

Posts:4

12/13/2007 1:22 PM Alert 
Same issue happens (and are MUCH more likely to happen) for following cache keys:

"SEOAdminMenu" & objCache.TabID.ToString & Convert.ToString(cinfo.Name)

"SEOMenuSkinObjectMenu" & objCache.TabID.ToString & username & Convert.ToString(cinfo.Name)

"SEOMenuModuleMenu" & Me.ModuleId.ToString & objCache.TabID.ToString & username & Convert.ToString(cinfo.Name)

"SEOMenuMenu" & Me.ModuleId.ToString & objCache.TabID.ToString & username & Convert.ToString(cinfo.Name)


An easy solution would be for instance using characters that cannot happen in the values concatenated to separate ids. For instance:

"SEOMenuMenu" & Me.ModuleId.ToString & "\t" & objCache.TabID.ToString & "\t" & username & "\t" & Convert.ToString(cinfo.Name)
fUser is Offline

Posts:4

12/13/2007 1:23 PM Alert 
I am sorry, it seems this Forum (using FF 2), submits every comment twice.
fUser is Offline

Posts:4

12/13/2007 1:23 PM Alert 
I am sorry, it seems this Forum (using FF 2), submits every comment twice.
You are not authorized to post a reply.
Forums > SEOMenu > Bugs/Fixes > SEO MENU 3.5.17 - Cache Bugs



ActiveForums 3.6
Login  |  Privacy Statement  |  Terms Of Use  |  Copyright 2006 by DNN SEO