For a new Helix resource, to implement HTTP caching by providing the Cache-Control header , you must create a new Helix prototype that implements the Info interface of the resource.
In the prototype, a ResourceInfo is built and the max-age for the resource is returned.
- /**
- * Navigation prototype for Info operation.
- */
- public class InfoNavigationPrototype implements NavigationResource.Info {
- private static final Single<ResourceInfo> INFO_SINGLE = Single.just(ResourceInfo.builder()
- .withMaxAge(NavigationsResourceConstants.MAX_AGE)
- .build());
- @Override
- public Single<ResourceInfo> onInfo() {
- return INFO_SINGLE;
- }
- }
You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This site contains the guides for Commerce 6.13.0 through 7.4.1.
Visit new site