Closed onlinebizsoft closed 2 years ago
Hi @onlinebizsoft. Thank you for your report. To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@mrtuvn @sivaschenko @ihor-sviziev
Actually it's only note deprecated and nothing removed in code base. You still can use private scope variable. But i think we should update docs content for clarify lack of information new cache approach. New approach for private content is like product compare functional (section ajax update) https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Catalog/etc/frontend/sections.xml#L11 Some other cases we can set cache_lifetime (via xml or php block) to false for dynamic block content https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml#L18 Or wrap Esi (varnish) with ttl define https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Theme/view/frontend/layout/default.xml#L76 cc: @Vinai Maybe he will have more details on this area Current magento still used old way (scopePrivate) in some other places example Checkout Blocks New functional while developments i rarely use scopePrivate and definitely avoid cacheables false in some cases
@mrtuvn you refer to product compare but it is not same, it could be done with "private data" because an user action "add to compare" can trigger an invalidation,.... However the private scope variable is helpful when we want a small non-cacheable block on all pages
The main benefit from my point of view is that private scope blocks make migrating blocks from Magento 1 to Magento 2 very easy. It would be cool if the deprecation note from the docs would be removed.
Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @mrtuvn ,
Thank you for raising an issue , we are happy to work on this issue . Kindly provide steps to reproduce , actual results with screenshots.
Regards,
We have noticed that this issue has not been updated for a period of more than 14 Days. Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this.
lol
We are reopening this issue for further analysis.
Hi @engcom-Lima. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
HI @onlinebizsoft,
I have gone through the conversation happened on this issue and did some research on same.
Based on it, I think the decision to discourage the use of _isScopePrivate()
is related to performance and main purpose was ‘Reduce AJAX requests due to non-cacheable blocks’ as suggested in the below article:
https://developer.adobe.com/commerce/php/development/cache/page/private-content/
And for the example which you have provided, I agree for the use case which you mentioned, _isScopePrivate()
can be seen as work approach but that’s why it is recommended to handle it on the web browser or client side instead of sending multiple requests to server. Since _isScopePrivate()
can trigger additional AJAX requests, that is why it is discouraged from Magento’s performance perspective.
Hope the above explanation is helpful. If you still have any doubt, feel free to comment back or let us know if we can close this issue ?
Thanks
Hi @onlinebizsoft ,
We have noticed that this issue has not been updated for a period of 14 Days. Hence we assume that this issue is fixed now, so we are closing it.Please raise a fresh ticket or reopen this ticket if you need more assistance on this.
Thanks
Summary (*)
Related to https://github.com/magento/magento2/pull/31754 https://support.magento.com/hc/en-us/articles/360040208612--isScopePrivate-in-private-content-blocks-slows-Magento-performance https://devdocs.magento.com/guides/v2.3/extension-dev-guide/cache/page-caching/private-content.html
_isScopePrivate couldn't be replaced by "private content" completely
Examples (*)
When you have a small block for announcement which appears on every page of the website, it has no interaction with user action (different from users action like adding to cart,....). The block may have content changed often but you wont want to flush whole cache to get it updated to every user. In this case you really want to use _isScopePrivate or ESI hole punching (depends on developer choice). It can't be done or replaced by "private content"
Proposed solution
So I don't understand why you are going to remove _isScopePrivate in future? We should keep the feature as it is and you just need to change to "private content" for necessary user cases.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.