BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe Exam AD0-E716 Topic 10 Question 37 Discussion

Actual exam question for Adobe's AD0-E716 exam
Question #: 37
Topic #: 10
[All AD0-E716 Questions]

An Adobe Commerce developer is tasked with creating a custom block that will be displayed on every page in the footer of the site.

After completing and optimizing the development, the developer notices that the block takes too much time to be generated on each page and decides to store it in the system cache after enabling it for all cache groups.

What would be the minimum requirement to achieve this?

Show Suggested Answer Hide Answer
Suggested Answer: C

To store a block in the system cache, the developer needs to set values for both the cache_lifetime and cache_key data properties of the block. The cache_lifetime property specifies how long the block should be cached, and the cache_key property specifies a unique identifier for the block.

The following code shows how to set the cache_lifetime and cache_key data properties of a block:

PHP

$block->setData('cache_lifetime', 600);

$block->setData('cache_key', 'my_custom_block');

Once the cache_lifetime and cache_key data properties have been set, the block will be stored in the system cache and will not be regenerated on each page load.


Contribute your Thoughts:

Currently there are no comments in this discussion, be the first to comment!


Save Cancel