The soft state based query result cache (SQRC) on the hub caches (on request) the result of a READ_ENTITYSET request and applies paging on the result list. Consecutive paging requests for the same query result will then be served from that cache.

SQRC Requirements
A GET request for an entity set is requested by a client. This will be handled by the SQRC if the following conditions apply:
- The corresponding service has been soft state enabled in /IWFND/MAINT_SERVICE.
- This again is only possible if the corresponding DPC (data provider class) redefines the methods of interface: /IWBEP/IF_MGW_SOST_SRV_RUNTIME.
- Also this means that both /IWFND/ and /IWBEP/ are at least on SAP Gateway 2.0 SP09 (7.40 SP08).
- The GET_ENTITYSET method of the DPC_EXT class has to provide the following functionalities:
- Applies the filter (system query option $filter)
- Applies the sorting (system query option $sort)
- Does not apply the paging (system query options $top and $skip)
- Returns together with the list of entities ES_RESPONSE_CONTEXT-DO_CACHE_AND_PAGE_ON_HUB = ABAP_TRUE
- Does not do server side paging (triggered via ES_RESPONSE_CONTEXT-SKIPTOKEN or ES_RESPONSE_CONTEXT-EXPAND_SKIPTOKEN)
- Consecutive client requests are a GET request on an entity set
- And the only difference between the request URLs are the values of the $top and $skip system query options. The rest of the URL must be identical.
SQRC Sample Code
IF ( mv_is_softstate = abap_false ).
lv_is_sqrc_allowed = abap_false.
ELSE.
lv_is_sqrc_allowed =
io_tech_request_context->is_cache_page_on_hb_allowed( ).
ENDIF.
* Paging preparation
IF ( lv_is_sqrc_allowed = abap_false ).
*- get number of records requested
lv_top = io_tech_request_context->get_top( ).
*- get number of lines that should be skipped
lv_skip = io_tech_request_context->get_skip( ).
*- value for maxrows must only be calculated
* if the request also contains a $top
IF lv_top IS NOT INITIAL.
lv_maxrows-bapimaxrow = lv_top + lv_skip.
ENDIF.
es_response_context-do_cache_and_page_on_hub = abap_false.
ELSE.
es_response_context-do_cache_and_page_on_hub = abap_true.
ENDIF.
SQRC Important Considerations
SQRC should only used it if all of the following conditions apply to the provider application:
- The data retrieval is very expensive (slow)
- The data retrieval cannot be made any faster, for example, the data is retrieved from some underlying business framework that is not owned by the provider application. But even in this case, the first and best fix is to address the performance problems where it has occurred.
- Caching of large entity sets must be avoided.
- If the entity set contains thousands or even hundred of thousands of entries, filtering must be used first.
- The provider application might for example refuse the first READ_ENTITYSET if no decent filter has been provided
- It must be made clear to the customer that using soft state might make the application faster but consequently more memory is used.