I have a strange behaviour with the cache in my TYPO3 installation:
Situation:
TYPO3 v9.5.22
the cache for the page exists
the page is only accessible for a certain FE usergroup
cache is build with EXT:crawler (the configuration is setup with the needed FE usergroup)
First test
I am logged in with a FE user with the needed FE usergroup
Result:
Page needs long time on first request, runs fast on second request
→ that feels as if the cache does not exist but is build with the first request
Second test
still logged in with same FE user from first test
also logged in as BE user with activated adminPanel
settings in the adminPanel:
"No cache" is not checked (so cache should be used)
Result:
Same behaviour as in first test, adminPanel → TypoScript shows that page is build (Page generation), so cache is not used
Third test
all settings from second test
settings in adminPanel:
simulate FE usergroup → choose the needed FE usergroup
Result:
Fast response, adminPanel show that cache is used.
My conclusion:
cache in general works
warm up fails somehow → crawler configuration might be falsy?
What can be the reasons for this behaviour?
Is my configuration falsy?
Can some other settings in TYPO3 create this situation?
The problem was following:
the page is access restricted with a single FE usergroup
in the crawler configuration I added only the single FE usergroup which was needed to access the page
the FE user had two FE usergroups.
The reason why the cache from the crawler is not taken into account depends on the way how TYPO3 caching works:
TYPO3 gets all FE usergroups of a user.
These FE usergroups are one of the input parameter to caculate a hash.
This hash is an identifier. It is used to check whether a cache was already build with these parameters.
My crawler was set up with only one FE usergroup but my test user has two of them.
That's why the hash will be different. So the cache which was created by the crawler is not taken into account.
So the solution would be: Create a crawler configuration for every possible FE usergroup configuration which could users have.
Related
I have multi store set up in Magneto extension,during development phase I disabled cache but now my development is over and I want to enable cache to increase the performance of my site.But as I enabled cache from Admin my website show abnormal behavior i.e.,show blank screen in Admin and in front end or not showing product in category page.This is the two case I found as i Enabled cache.
Please tell me how to enable cache without disturb my all site.
Above issue is solve by:-
You may be using an alternative cache backend, in such case, using the Flush Cache Storage button should be sufficient to empty the cache contents and then enable cache of "Blocks HTML output".
Your cache blocks might not be have a store ID as a key element.
This might result in cache getting shared and resulting in wrong blocks being displayed.
My clients Magento-site is hosted on SiteGround with SuperCacher activated. SuperCacher is a SiteGround optimized version of Varnish.
It uses a version of Turpentine for Varnish caching.
I've got at Search block that is only visible to logged in users.
This block won't show up when Varnish is activated.
When I specify af ESI policy with ttl 0 for the Search block, it becomes visible but for both logged in and logged out users.
How do I leave this block out of the cache and only show up for logged in users?
this link is very useful to me in this link explanation for how to remove block from cache Magento Hole puch With Varnish Hope this will also helpful to you.
For some reason, after debugging i've noticed that form_keys are valid only after i clear the cache by doing a manual rm -rf * in the var folder, clearing my browser cache and retrying the site.
I have made no changes to the core code, I've diffed it to the original 1.8.1 installation, and they are exactly the same.
The original problem I had was that customers couldn't login because I had been using a customer/persistent/login.phtml file from the 1.7.0.2 version, and had to change it to add the form_key as a hidden input element using the method shown in all other posts about the new addition of form keys in magento 1.8.1.
I had captcha enabled, and for some reason when I went to the customer login, captcha isn't displayed.
Randomly, I don't know what I did, the page refreshed, and the captcha displayed and I was able to login to the dashboard and it worked. Then I logged out, and the same problem happened, the customer logs in with the correct username/password, but is redirected to the same customer login page.
I have debugged the loginPostAction in AccountController.php from app/code/core/mage/customer/controllers, and it appears that when the form key is valid, after refreshing cache, clearing cache, in mage and the browser, it reaches if( getIsJustConfirmed == true){ go to __welcomedashboard(..) } however getIsJustConfirmed returns null or false.
I did a check to see where getIsJustConfirmed is set, and it appears in setCustomer of the Session.php inside app/code/core/mage/customer/Session.php:
public function setCustomer(Mage_Customer_Model_Customer $customer)
{
// check if customer is not confirmed
if ($customer->isConfirmationRequired()) {
if ($customer->getConfirmation()) {
return $this->_logout();
}
}
$this->_customer = $customer;
$this->setId($customer->getId());
// save customer as confirmed, if it is not
if ((!$customer->isConfirmationRequired()) && $customer->getConfirmation()) {
$customer->setConfirmation(null)->save();
$customer->setIsJustConfirmed(true);
}
return $this;
}
the first part of !$customer->isConfirmationRequired() always returns true, however $customer-->getConfirmation() returns null, so it doesn't setIsJustConfirmed(true).
As you've noticed, Magento 1.8 adds form keys to a whole lot of forms. The form key in the hidden input field needs to match the form key in your user's session. This plays havoc with any form of caching, as the form key stored in the block or full page cache is unlikely to match the user's session key.
Firstly, I'll assume you've already compared the templates you've copied into a custom theme against the base/default versions and added form keys wherever they're missing.
Then, the next suggestion is to turn all caching in Magento off (and any full page caches such as Varnish) and see if that resolves the problem. This will confirm that you're caching form keys somewhere and this is the cause of your problem.
Next, use a tool like Fabrizio's Advanced Template Hints to see if any of the templates containing a form key are being cached, either explicitly or implicitly via a parent block. If so, this is the cause of your problem, and you'll need to investigate what is causing these blocks to be cached. A stock Magento system won't cache these blocks, but a 3rd party extension might be causing it.
Finally, once the block cache is resolved, you'll need to think about full pace caching (if used). There's no easy answers here, you'll need to either not cache the affected pages in a FPC, or find a way to put the correct form key into the page after it's served.
Step-by-step, I was having the same issue. I started logging the session key output by Mage::log(Mage::getSingleton('core/session')->getFormKey()); on each page load.
Until attempting to login as a customer, the session remained consistent.
However, after attempting to log-in, I determined that the session was getting invalidated on each page load (i.e. the aforementioned logging method echoed a different form key on each page load).
This led me to the cookie. I noticed that after attempting to log in as a customer, there were two frontend cookies stored by the browser: one with .my_domain.com and another with just my_domain.com, thereby causing the invalidation.
Setting the cookie Domain under System -> Configuration -> General -> Web to my_domain.com addressed the duplicate cookie problem and the forms behaved as expected.
I have some 4.5.6 installation of TYPO3 and a quite old, modified tt_news extension running.
My client noticed that the indexed search is not working for the news pages anymore.
So i checked, and as I thought the cache entries for the detail pages are not created anymore.
Actually only one cache entry is created, containing the html of the first detail page I requested (through the frontend).
I enabled the adminPanel and it also shows me that no_cache = 1. Why is that? My URL looks like this:
www.mypage.com?id=231&tx_ttnews[tt_news]=2457&tx_ttnews[backPid]=&tx_ttnews[swords]=&cHash=287ca316c98761c2dff769a7d3c6b587
Anyone can help me with that?
There are several places to disable the TYPO3 page cache.
a) It can be set by TypoScript using
config.no_cache = 1
or
page.config.no_cache =1
Check in the TypoScript Object Browser if it is set on this page and check how it is set.
b) It can be set in the page properties.
c) It can be set in an extension. If e.g. your customized version of tt_news contains this code
$GLOBALS['TSFE']->set_no_cache()
the cache for all pages containing the plugin is disabled.
Furthermore the plugin can be made running as a USER_INT like this
$this->pi_USER_INT_obj = 1;
If this is set, then the content of this plugin is not checked. E.g. on the page you opened the admin panel, you have three USER_INT objects. But this is not the problem since you have set "no_cache" which means that the cache for the whole page is disabled.
The problem was related to realUrl. We updated to a new version, and then caching worked again. Looks like realUrl generated invalid cHashes...
I am having a weird situation. I worked on a magneto ecommerce website. My friends and I can see the products on the website, but only my client can't see any of them.
I suspected magento cache, so I refreshed and disabled all the caches. My client still can't see all the products. I made him to clear browser cache. It didn't work as well. I also let him use FF or Safari. He still can't see the products.
What is the problem??? I can't try any other things now...
In addition to checking multiple websites, are you logged in or do you have a specific customer group? Magento allows you to show products only to certain customers. Check to make sure that as a logged-out, anonymous user, you can see the products.
Hope that helps,
Joe
Have you configured multiple stores, websites or store views in your Magento instance? Whether or not Magento displays a product depends on a lot of settings, but if one user can, and another user cannot see them, it's most likely related to which store view they are accessing.
The store view Magento is showing isn't always determined by the URL alone, there is also a setting which is stored in the cookie and can be changed via a dropdown (in the default templates anyway).
Stores are configured via System > Manage Stores. If you have multiple rows in there you have multiple store views (or websites or stores).