[MGNLADVCACHE-90] Double call components with advanced cache. Created: 09/Jun/17 Updated: 17/Jul/17 Resolved: 17/Jul/17 |
|
| Status: | Closed |
| Project: | Advanced Cache |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Vyacheslav Maksimov | Assignee: | Roman Kovařík |
| Resolution: | Workaround exists | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
tomcat-8.5.5, java8, ubuntu 16.04. Connected molules: sitemesh, advancedcache and memcached implementation. |
||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Date of First Response: |
| Description |
|
I have a component with defined fragmentDefinition. I request the magnolia component on the client side from the external system, as shown in https://documentation.magnolia-cms.com/display/DOCS/Rendering+content in the "Direct component rendering" section. As a result, there are next problems: |
| Comments |
| Comment by Roman Kovařík [ 12/Jun/17 ] |
|
Hi mrslavutich,
Could you share your use case and version of advanced cache and sitemesh you're using? Thanks in advance. |
| Comment by Vyacheslav Maksimov [ 13/Jun/17 ] |
|
Hi, Roman Kovařík I have the external website that calls on the client side of the magnolia component on the url = http://localhost:8080/main/0. The component defined in the buyNowSection.yaml: templateScript: /integration-mvideo/templates/components/home/buyNowSection.ftl advancedcache:1.8.2 Thanks. |
| Comment by Roman Kovařík [ 13/Jun/17 ] |
|
Hi,
public class ProductBuyNowModel {
private final Provider<CacheInstructor> cacheInstructorProvider;
@Inject
ProductBuyNowModel(..., Provider<CacheInstructor> cacheInstructorProvider) {
...
this.cacheInstructorProvider = cacheInstructorProvider;
}
@Override
public void execute() {
cacheInstructorProvider.get().setTtl(100);
}
}
Than you don't need to use the DPC at all. Hope that helps. |
| Comment by Vyacheslav Maksimov [ 13/Jun/17 ] |
|
Ok, thank you, but i still have to customize RenderableDefinition to include your ttl. In my opinion, it would be nice to include in the overall core functionality. Returning to the second topic, double component rendering. I have another case, there is a page with the product, which contains several components: pageTop.yaml: And so on. At the initial request in the browser, all components are rendered and cached, then the second request(if CachePolicyResult.useCache = true) again renders the same components marked as dymanic and this is a problem. I think you should avoid rendering when the primary query is used, if marked as dynamic to avoid overhead. |
| Comment by Roman Kovařík [ 14/Jun/17 ] |
You can set skipRendering on the fragment injection listener: |
| Comment by Vyacheslav Maksimov [ 14/Jun/17 ] |
|
Thank you, I think this decision is appropriate. |