~~NOTOC~~
====== General Troubleshooting Guide for LiteMage ======
== ==
\\
[[#cache_size_growing_too_large|Cache Size Growing Too Large]]\\
[[#uninitialized_php_variables_in_injected_blocks|Uninitialized PHP variables in injected blocks]]\\
[[#javascript_global_variable_problem|JavaScript global variable problem]]\\
[[#magento_connect_exception_during_cache_and_session_cleaning_error|Magento Connect “Exception during cache and session cleaning” Error]]\\
[[#magento_front-end_session_timing_out_too_soon|Magento front-end session timing out too soon]]\\
[[#error_message_when_using_templates_with_ajax_based_navigation|Error Message When Using Templates With AJAX Based Navigation]]\\
[[#Error_Message:_"Your_installation_of_LiteSpeed_Web_Server_does_not_have_LiteMage_Cache_enabled"|Error Message: "Your installation of LiteSpeed Web Server does not have LiteMage Cache enabled"]]\\
[[#Header/Footer_Disappear_After_Enabling_LiteMage_Cache|Header/Footer Disappear After Enabling LiteMage Cache]]\\
[[#Turning_On_Maintenance_Mode_While_LiteMage_Is_Enabled|Turning On Maintenance Mode While LiteMage Is Enabled]]\\
[[#Pop-ups_Will_Sometimes_Not_Appear|Pop-ups Will Sometimes Not Appear]]\\
[[#Form_Keys_Being_Displayed_On_Web_Page|Form Keys Being Displayed On Web Page]]\\
[[#Unable_To_Redirect_404_Pages_To_Search_Results|Unable To Redirect 404 Pages To Search Results]]\\
[[#3rd_Party_Store/Currency_Auto_Switcher_Not_Redirecting_To_Correct_Page|3rd Party Store/Currency Auto Switcher Not Redirecting To Correct Page]]\\
[[#Logged_In_Usernames/Cart_Items_Being_Shown_On_Other_User's_Pages|Logged In Usernames (Or Cart Items) Being Shown On Other User's Pages]]\\
[[#need_additional_support?|Need Additional Support?]]
==== Cache Size Growing Too Large ====
If you find that LiteMage's cache is becoming overly large, it is likely that you need to perform some "cleanup". For direction on how to do this please refer to our entry on [[litespeed_wiki:cache:litemage:administration#litemage_cache_cleanup|LiteMage Cache Cleanup]].
==== Uninitialized PHP variables in injected blocks ====
Some customized themes may reference user initialized global PHP variables in injected blocks. When those ESI blocks render, null pointer errors will occur as those variables may have been initialized earlier but the injected block has no way of recognizing them.
For example, for SNS themes: the footer template may fail to output due to the variable "$var_snstheme" actually being initialized in the header block.
Solution: Find the code where this variable is initialized copy this logic to the template of the injected block. For example, adding the following 2 lines:
global $var_snstheme;
if (empty($var_snstheme)) {
include (dirname(dirname(__FILE__)).'/sns/sns.php');
}
Similarly, for SM themes (such as sm-maxshop yttheme):
if (empty($var_yttheme)) {
include (dirname(dirname(__FILE__)).'/sm/yt_prepar.php');
}
Alternatively you can remove footer block injection from LiteMage config.xml. This however will slow down page loading time as well as increase cache size and is hence not recommended.
==== JavaScript global variable problem ====
If a global variable in JavaScript is initialized based on user session data and saved in a public cache, then it will cause trouble for other users with differing session data.
As of version 1.0.2, a place holder block for JavaScript variables has been introduced. This place holder is a private block, so every user will get his/her own correct value.
Check the code:
code/community/Litespeed/Litemage/Block/Inject/Jsvar.php
You can also write your own code to customize this block. Please be sure to keep a copy of your customized code in a local directory to avoid it being overridden during LiteMage updates.
You generally do not need to modify the block code and can instead just modify the template associated with that block.
app/design/frontend/base/default/template/litemage/inject/jsvar.phtml
For example:
"isLoggedIn" is used by an SNS ajax cart for wishlists. In LiteMage's config.xml file located under magento_install_directory/app/code/community/Litespeed/Litemage/etc, this block, "litemage.jsvar", is listed under "welcome" and will be purged by logged_in/out events.
If you have any other variables based on events not already represented in LiteMage's config.xml file, you can add them in as new blocks in the "esiblock" section. (Be sure to add a LiteMage ESI observer for these events as well)
==== Magento Connect “Exception during cache and session cleaning” Error ====
When using the Magento Connect manager with certain browsers you may receive an "Exception during cache and session cleaning" error message in the Magento Connect output frame when attempting to either install or reinstall LiteMage. If this occurs, LiteMage will still be installed but your Magento site will become stuck in maintenance mode and therefore be inaccessible.
The reason for this is that when Magento Connect attempts to install any new modules to your store, it first creates a "maintenance.flag" file in the root directory. The presence of this file signals that your site is now in maintenance mode and changes can be safely made. Under normal circumstances this file should be automatically deleted once the installation has completed, but certain errors (such as this one) can cause Magento Connect to halt before reaching the removal step.
To fix this simply delete the “maintenance.flag” file from the root folder of your affected Magento site.
This issue is known to occur in the following browsers: Firefox
==== Magento front-end session timing out too soon ====
If your Magento site is timing out faster for users than your current "Cookie Lifetime" setting (default is 3600 seconds), PHP’s session.gc_maxlifetime parameter may be the problem.
Firstly, check your "Cookie Lifetime" setting to ensure it is set correctly by logging in to the Magento Admin Panel and navigating to System -> Configuration and clicking "Web" under "GENERAL" in the left side menu. Look under "Session Cookie Management" for "Cookie Lifetime" and make sure that it is set as intended (in seconds).
Assuming that this was not the issue, open your sites php.ini file and look for "session.gc_maxlifetime". If this is set to a smaller total number of seconds than your Magento "Cookie Lifetime" setting, PHP will clear the session data before Magento has the chance.
To fix this simply set "session.gc_maxlifetime" to a number greater than or equal to "Cookie Lifetime" and save your php.ini file.
==== Error Message When Using Templates With AJAX Based Navigation ====
If you are using a Magento theme that has AJAX based navigation, it is possible that you will encounter an error when trying to navigate to certain pages. This can be caused by your browser receiving the wrong cached response as a result of the way your template handles AJAX requests.
For example:
Let's assume that your current URL is something like "your_site_url.html" and you are looking at page one. By visiting this page, the HTML response is now cached by LiteMage using it's URL. You then click on the second page which will be an AJAX call, the JSON response is also cached by LiteMage using it's URL.
Now say you want to click on your current page (page 2) again. You would assume that the cached JSON response for page 2 would be returned, but the URL used for requesting the current page is:
your_site_url.html#
Which your browser will interpret as "your_site_url.html", thereby requesting the previously cached copy of page 1 instead. This happens because both requests are pointing to the same cached URL, so whatever is cached first will be returned.
You can fix this easily by modifying your theme's template with a single line change as we do below for the example sm_market theme (located under app/design/frontend/sm_market/default/template/page/html/pager.phtml):
Note: The sm_market theme appends additional information to the end of a URL to notify the back-end when it wants to make an AJAX request. For example, an AJAX request for page 2 of "test.html" would become "test.html?p=2&isLayerAjax=1" when using the sm_market theme. This appended information will vary from theme to theme.
Original
getFramePages() as $_page): ?>
isPageCurrent($_page)): ?>
RewriteCond %{HTTP_COOKIE} !frontend
RewriteCond %{HTTP_USER_AGENT} !(litemage_walker|googlebot|bingbot|googlebot|yahoo) [NC]
RewriteRule .* - [E=Cache-Control:vary=hitback,E=Cache-Control:no-cache]
These rules will check if the "frontend" cookie is not set, which will always be the case on a customers first visit, and if the user agent is not a bot. If these conditions are met, we then force the request to hit the backend using a fake cookie vary.
Lastly, in order for LiteMage's crawler to properly crawl your multiple currencies/stores, you must also **add "/litemage_walker/" to your auto switcher's disabled user agents list**.
**For example:** In Extendware's Store / Currency Switcher, you can disable auto-switching for any user agents matching an input regular expression. Simply navigate to Disabled User Agents >> User Agent RegExp and add "/litemage_walker/".
==== Logged In Usernames/Cart Items Being Shown On Other User's Pages ====
//Seen In:// Ultimo Theme, Meigee Harbour Theme
This issue is caused when the block containing the username is not being punched properly. This causes private information to be publicly cached and displayed on public pages.
To confirm that this is the problem, you can enable debug mode and append **?LITEMAGE_DEBUG=SHOWHOLES** to the end of your site url. This will show all holes being punched on the page, where you can check if the block containing the username or cart items is being punched properly.
The simplest solution to this problem is to go to the Magento Admin Panel and navigate to **System->Configuration->LiteMage Configuration** and add "header" to **Customized Block Names for "toplinks" Tag**. This will punch a hole for the entire header block.
The more complicated solution involves looking carefully at your template file for customized code, such as
';}
if (Mage::getSingleton('customer/session')->isLoggedIn()==1):
echo '' . $customer->getCustomer()->getName() . '
span>';
endif;
Since LiteMage can only punch a hole on a block defined through a layout file, the dynamically generated content here will not be recognized. You can however create a new block containing this logic and define that block in the layout file with a unique name. Once you have done this you can then add this new block name to the **Customized Block Names for "toplinks" Tag** list.
==== Need Additional Support? ====
If you need any additional support or help installing, configuring, or troubleshooting LiteMage for your Magento store, have a look at our [[litespeed_wiki:cache:litemage:troubleshooting:support|LiteMage Support]] page.