Search

CN-122001947-A - Cross-domain caching method, device, equipment, medium and program product

CN122001947ACN 122001947 ACN122001947 ACN 122001947ACN-122001947-A

Abstract

The disclosure provides a cross-domain caching method which can be applied to the technical fields of computers, web page application and caching, and comprises the steps of responding to a received access request for accessing a target cache file through a current domain name, inquiring in a target temporary cache file group of the current domain name of a local cache space based on the access request, wherein the local cache space is used for storing temporary cache file groups of different domain names, the cache files in each temporary cache file group are obtained through different domain names, the different domain names are respectively used for calling different application services, and loading the target cache file into the application services of the current domain name under the condition that the target cache file exists in the target temporary cache file group. The present disclosure also relates to a cross-domain caching apparatus, device, medium, and program product.

Inventors

  • LI WANRU

Assignees

  • 北京京东远升科技有限公司

Dates

Publication Date
20260508
Application Date
20241105

Claims (13)

  1. 1. A cross-domain caching method, comprising: In response to receiving an access request for accessing a target cache file through a current domain name, querying a target temporary cache file group of the current domain name in a local cache space based on the access request, wherein the local cache space is used for storing temporary cache file groups of different domain names, each cache file in the temporary cache file group is acquired through a different domain name, and the different domain names are respectively used for calling different application services, and And under the condition that the target cache file exists in the target temporary cache file group, loading the target cache file into the application service of the current domain name.
  2. 2. The method of claim 1, wherein the local cache space is further for storing shared cache file groups that synchronize shared files to respective temporary cache file groups of different domain names; The method further comprises the steps of: And under the condition that the target shared file exists in the shared cache file group, generating the target cache file in the target temporary cache file group of the current domain name according to the target shared file.
  3. 3. The method of claim 2, wherein the generating the target cache file from the target temporary cache file group under the cache path of the current domain name according to the target shared file in the shared cache file group includes: Decrypting the target shared file according to the decryption key of the target shared file to obtain the decrypted target shared file; and under the condition that the sharing authority of the current domain name is matched with the sharing authority of the target sharing file, generating the target cache file which can be accessed by the current domain name in a target temporary cache file group of the current domain name according to the decrypted target sharing file. The decryption key and the sharing authority are obtained from a remote server, and the remote server is configured with the sharing authority information of different domain names and the decryption key of a shared file.
  4. 4. A method according to claim 3, further comprising: under the condition that the target shared file does not exist in the shared cache file group, inquiring the cloud storage space of the remote server based on the access request; acquiring the target shared file under the condition that the cloud storage space is determined to exist in the target shared file; And storing the target shared file into the shared cache file group of the local cache space.
  5. 5. The method of claim 4, wherein the target cache file is obtained by a target domain name, the method further comprising: Acquiring the target cache file from a temporary cache file group of the target domain name of the local cache space under the condition that the cloud storage space is determined to not have the target shared file; and transmitting the target cache file to the remote server, so that the remote server encrypts the target cache file to form the target shared file, and storing the target shared file in the cloud storage space.
  6. 6. The method of any of claims 1-5, further comprising: And under the condition that the data update exists in the local cache space, transmitting the updated temporary cache file to a remote server, so that the remote server updates the corresponding shared cache file in the cloud storage space based on the updated temporary cache file, and generating a cloud update identification used for representing that the shared cache file is updated.
  7. 7. The method of claim 6, wherein the method further comprises: Under the condition that the cloud updating identification exists in the remote server, acquiring an updated shared cache file from the cloud storage space; updating the shared cache file corresponding to the local cache space according to the updated shared cache file, generating a local update identification for representing that the shared cache file is updated, and And sending an instruction for deleting the cloud update identification to the remote server.
  8. 8. The method of claim 7, wherein the method further comprises: under the condition that the local update identification is detected, acquiring the updated shared cache file; And respectively updating the temporary cache files of different domain names according to the updated shared cache files, and updating the local update identification of the updated shared cache files.
  9. 9. The method of claim 1, wherein the method further comprises: And deleting the temporary cache file of the current domain name in response to receiving an exit request for exiting the current domain name.
  10. 10. A cross-domain caching apparatus, comprising: A query module, configured to query, in response to receiving an access request for accessing a target cache file through a current domain name, a target temporary cache file group of the current domain name in a local cache space based on the access request, where the local cache space is configured to store temporary cache file groups of different domain names, each of the temporary cache file groups having a cache file obtained by a different domain name, the different domain names being used to invoke different application services, and And the processing module is used for loading the target cache file into the application service of the current domain name under the condition that the target cache file exists in the target temporary cache file group.
  11. 11. An electronic device, comprising: One or more processors; A memory for storing one or more programs, Wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1 to 9.
  12. 12. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to implement the method of any of claims 1 to 9.
  13. 13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 9.

Description

Cross-domain caching method, device, equipment, medium and program product Technical Field The present disclosure relates to the field of computer technology, the field of web application technology, and the field of cache technology, and more particularly, to a cross-domain cache method, apparatus, device, medium, and program product. Background With the rapid development of computer technology, in order to meet diversified functional requirements, different domain names often need to be nested in a large-scale integrated system to call corresponding application services. Thereby realizing efficient service integration and user access experience. In the process of realizing the disclosed conception, the inventor finds that at least the following problems exist in the related art, namely, due to the limitation of the homologous strategy of the browser, the cache data cannot be directly accessed in a cross-domain mode through the front end, and the problem of network delay exists when the cross-domain access is performed based on the server. Disclosure of Invention In view of this, the present disclosure provides a cross-domain caching method, apparatus, device, medium, and program product. One aspect of the disclosure provides a cross-domain caching method, which comprises the steps of responding to a received access request for accessing a target cache file through a current domain name, inquiring a target temporary cache file group of the current domain name in a local cache space based on the access request, wherein the local cache space is used for storing temporary cache file groups of different domain names, each temporary cache file group is obtained through a different domain name, the different domain names are respectively used for calling different application services, and loading the target cache file into the application services of the current domain name under the condition that the existence of the target cache file in the target temporary cache file group is determined. According to an embodiment of the present disclosure, the local cache space is further used to store a shared cache file group that synchronizes the shared file to a respective temporary cache file group of a different domain name. The method further comprises the step of generating the target cache file in the target temporary cache file group of the current domain name according to the target shared file under the condition that the target shared file exists in the shared cache file group. According to the embodiment of the disclosure, a target temporary cache file group is generated under a cache path of a current domain name according to a target shared file in a shared cache file group, wherein the target temporary cache file group comprises a target shared file which is decrypted according to a decryption key of the target shared file to obtain a decrypted target shared file, and a target cache file which can be accessed by the current domain name is generated in the target temporary cache file group of the current domain name according to the decrypted target shared file under the condition that the sharing authority of the current domain name is matched with the sharing authority of the target shared file. The decryption key and the sharing authority are obtained from a remote server, and the remote server is configured with the sharing authority information of different domain names and the decryption key of the sharing file. According to the embodiment of the disclosure, the method further comprises the steps of inquiring the cloud storage space of the remote server based on the access request when the fact that the target shared file does not exist in the shared cache file group is determined, acquiring the target shared file when the fact that the target shared file exists in the cloud storage space is determined, and storing the target shared file into the shared cache file group of the local cache space. According to the embodiment of the disclosure, the target cache file is acquired through the target domain name, and the method further comprises the steps of acquiring the target cache file from a temporary cache file group of the target domain name of the local cache space under the condition that the cloud storage space is determined to not have the target shared file, transmitting the target cache file to a remote server, enabling the remote server to encrypt the target cache file to form the shared cache file, and storing the shared cache file in the cloud storage space. According to the embodiment of the disclosure, the method further comprises the steps of transmitting the updated temporary cache file to a remote server under the condition that the data update exists in the local cache space, so that the remote server updates the corresponding shared cache file in the cloud storage space based on the updated temporary cache file, and generating a cloud update identification used for representing that th