Apigee 지속성 기능에는 캐시, 키-값 맵, 속성 집합이 포함됩니다. Apigee Hybrid를 사용하는 경우 Kubernetes 보안 비밀을 사용하여 민감한 정보를 유지할 수 있습니다.
기능
사용
캐시
범용 캐싱에 대한 정책을 사용하면 프록시에 필요한 모든 객체를 여러 요청/응답 세션에서 유지할 수 있습니다. 또한 ResponseCache 정책을 사용하여 백엔드 리소스의 응답을 캐시할 수 있습니다. 응답 캐싱은 백엔드 데이터가 주기적으로만 업데이트되는 경우에 특히 유용합니다. ResponseCache 정책으로 백엔드 데이터 소스에 대한 호출을 줄일 수 있습니다.
키-값 맵
키-값 맵(KVM)은 주기적으로 변경될 수 있는 데이터의 일반 런타임 저장소를 제공합니다.
예를 들어 사용자 세션 데이터, 장바구니 등이 있습니다. KVM 항목은 암호화할 수 있습니다.
속성 집합
속성 집합은 자주 변경되지 않는 구성 데이터를 저장하는 데 유용합니다.
Kubernetes 보안 비밀
(Apigee Hybrid 전용) 보안 비밀을 사용하여 사용자 인증 정보와 같은 민감한 정보를 저장합니다.
캐시된 항목은 1초 동안 메모리(L1)에 유지됩니다. 이 구성을 변경할 수 없습니다.
1초 후에 캐시된 객체는 캐시가 만료될 때까지 사용 가능한 데이터베이스(L2)에 배치됩니다. 자세한 내용은 인메모리 영구 캐시 수준을 참조하세요.
캐시 정책 구성을 통해 만료 시간과 같은 캐시 세부정보를 관리합니다. 캐시 리소스를 나열 및 삭제할 수 있는 Apigee API가 제공됩니다.
캐시 정책을 사용하는 경우 캐시 키를 구성하여 캐시된 값 키의 고유성을 보장합니다. 구성 가능한 다른 값과 함께 캐시 키는 투입한 것과 동일한 데이터를 안정적으로 가져올 수 있는 방법을 제공합니다. 캐시 크기와 가용성에는 특정 한도가 적용됩니다.
캐시를 사용하여 다음을 수행할 수 있습니다.
지연 시간 및 트래픽 감소: 요청이 더 짧은 시간 안이, 재사용된 표현으로 충족됩니다.
트랜잭션 전체에서 데이터 유지: HTTP 트랜잭션 전체에서 재사용하도록 세션 데이터를 저장할 수 있습니다.
보안 지원: 캐시 항목에 액세스 범위를 설정하여 특정 환경 또는 특정 API 프록시에서만 액세스할 수 있도록 합니다.
백엔드 데이터가 주기적으로만 업데이트되는 경우에 특히 유용합니다. ResponseCache 정책으로 백엔드 데이터 소스에 대한 호출을 줄일 수 있습니다.
ResponseCache 정책을 통해 Apigee가 특정 HTTP 응답 캐싱 헤더를 확인하도록 하고 헤더 지시문에 따라 조치를 취할 수 있습니다. 예를 들어 백엔드 대상의 응답에서 Apigee는 Cache-Control 헤더를 지원합니다. 무엇보다도 이 헤더를 사용하여 캐시된 응답의 최대 수명을 제어할 수 있습니다. 자세한 내용은 HTTP 응답 헤더 지원을 참조하세요.
단기 범용 캐싱
범용 캐싱에 대한 정책을 사용하면 프록시에 필요한 모든 객체를 여러 요청/응답 세션에서 유지할 수 있습니다.
구조화된 데이터를 암호화하거나 암호화하지 않은 상태로 무기한 저장하려면 임의의 키-값 쌍이 포함된 키-값 맵(KVM)을 만들고 채웁니다. 예를 들어 다음 항목을 저장할 수 있습니다.
IP 주소를 국가 코드로 연결하는 맵
액세스가 허용/거부된 IP 주소 목록
긴 URL을 단축 URL로 연결하는 맵
할당량 수 및 OAuth 토큰 만료 시간과 같은 환경별 데이터
KVM은 조직, 환경, apiproxy와 같은 세 범위 중 하나를 사용할 수 있습니다. 예를 들어 조직의 모든 API에서 키-값 쌍이 사용되는 경우 조직 범위에서 KVM을 만듭니다. 또는 특정 API 프록시만 키/값에 액세스할 수 있어야 한다면 apiproxy 범위에서 KVM을 만듭니다. 자세한 내용은 키 값 맵으로 작업을 참조하세요.
속성 집합
속성 집합은 데이터를 저장하는 키-값 쌍의 커스텀 컬렉션입니다. API 프록시가 실행될 때 이 데이터를 검색할 수 있습니다.
일반적으로 속성 집합을 사용하여 구성 데이터와 같이 API 프록시 로직에 하드 코딩하지 않은 만료되지 않는 데이터를 저장합니다. 흐름 변수에 액세스할 수 있는 프록시의 모든 위치에서 속성 집합 데이터에 액세스할 수 있습니다.
속성 집합의 일반적인 사용 사례는 이런저런 환경과 연결된 값을 제공하는 것입니다. 예를 들어 테스트 환경에서 실행되는 프록시에 해당되는 구성 값으로 환경 범위 속성 집합을 만들고 프로덕션 환경에 대한 또 다른 속성 집합을 만들 수 있습니다.
(Apigee Hybrid만 해당) 이미 민감한 데이터의 커스텀 Vault에 있는 보안 비밀 관리에 Kubernetes를 사용하고 있는 경우 Kubernetes 보안 비밀을 사용하는 것이 좋습니다.
KVM 데이터와 마찬가지로 API 프록시 흐름 변수에 있는 Kubernetes 보안 비밀 데이터에 액세스할 수 있습니다.
자세한 내용은 Kubernetes 보안 비밀에 데이터 저장을 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-18(UTC)"],[[["\u003cp\u003eApigee offers several persistence features, including caches, key value maps (KVMs), and property sets, to store and manage data used by API proxies.\u003c/p\u003e\n"],["\u003cp\u003eCaches are used for general-purpose caching to persist objects across sessions, reduce latency, and cache backend responses for data that is updated periodically, with management of expiry times and keys through cache policies.\u003c/p\u003e\n"],["\u003cp\u003eKey value maps (KVMs) provide a long-term data store for arbitrary key/value pairs with different scopes, ideal for data like IP-to-country mappings or OAuth token expiration times.\u003c/p\u003e\n"],["\u003cp\u003eProperty sets are used to store non-expiring configuration data that can vary by environment, accessible via flow variables within API proxies.\u003c/p\u003e\n"],["\u003cp\u003eApigee hybrid users can utilize Kubernetes secrets to store and manage sensitive data, with this data being accessible in API proxy flow variables.\u003c/p\u003e\n"]]],[],null,["# Caching and persistence overview\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\nApigee persistence features include caches, key value maps, and\nproperty sets. If you are using Apigee hybrid, you can use Kubernetes secrets\nto persist sensitive data.\n\nCaching\n-------\n\n\nEnvironment-scoped cache resources are created dynamically when a cache policy executes within an API proxy flow.\nCache policies include the [PopulateCache policy](/apigee/docs/api-platform/reference/policies/populate-cache-policy),\n[LookupCache policy](/apigee/docs/api-platform/reference/policies/lookup-cache-policy), [InvalidateCache policy](/apigee/docs/api-platform/reference/policies/invalidate-cache-policy), and\n[ResponseCache policy](/apigee/docs/api-platform/reference/policies/response-cache-policy).\n\n\nA cached item stays in memory (L1) for one second. You cannot change this configuration.\nAfter one second, the cached object is placed in a database (L2) where it is available until\nthe cache expires. For details, see [In-memory persistent cache levels](/apigee/docs/api-platform/cache/cache-internals#inmemoryandpersistentcachelevels).\nYou manage cache details, such as expiry time, through\nconfiguration of a cache policy. An Apigee API is provided that allows you to [list and\ndelete](/apigee/docs/reference/apis/apigee/rest#rest-resource:-v1.organizations.environments.caches) cache resources.\n\nWhen using cache policies, you ensure the uniqueness of cached value keys by\nconfiguring [cache keys](/apigee/docs/api-platform/reference/policies/working-cachekeys). A cache key, along with other values you can\nconfigure, gives you a reliable way to get out the same data that you put in. Cache size\nand availability is subject to certain [limits](/apigee/docs/api-platform/reference/limits#persistence:-cache,-kvm,-property-sets).\n\nYou might want to use a cache to:\n\n- **Reduce latency and traffic.** Requests are satisfied in a shorter time and with reused representations.\n- **Persist data across transactions.** You can store session data for reuse across HTTP transactions.\n- **Support security.** Scope access to cache entries so they can be accessed only in a particular environment or by a specific API proxy.\n\n### Backend response caching\n\nYou can cache the response of a backend resource with the\n[`ResponseCache` policy](/apigee/docs/api-platform/reference/policies/response-cache-policy).\n\nThis is especially helpful when backend data is updated only periodically. The `ResponseCache`\npolicy can reduce calls to backend data sources.\n\nThrough the `ResponseCache` policy, you can also have Apigee look at certain HTTP response caching\nheaders and take actions according to header directives. For example, on responses from backend\ntargets, Apigee supports the `Cache-Control` header. This header can be used to control\nthe maximum age of a cached response, among other things. For more information, see\n[Support for HTTP response headers](/apigee/docs/api-platform/cache/http-response-caching).\n\n### Short-term general purpose caching\n\nUsing policies for general purpose caching, you can persist any objects your proxy requires\nacross multiple request/response sessions.\n\nWith the [`PopulateCache`\npolicy](/apigee/docs/api-platform/reference/policies/populate-cache-policy), [`LookupCache`\npolicy](/apigee/docs/api-platform/reference/policies/lookup-cache-policy), and [`InvalidateCache` policy](/apigee/docs/api-platform/reference/policies/invalidate-cache-policy),\nyou can populate, retrieve, and flush cached data at runtime.\n\nFor example, you might temporarily store:\n\n- Session IDs for session management.\n- Credentials for outbound calls (such as API keys or OAuth access tokens).\n- Response content that must be paginated for apps.\n\nAt runtime, your cache policies copy values between proxy variables and the configured cache\nyou specify. When a value is placed in the cache, it is copied from the variable you specify to\nthe cache. When it is retrieved from the cache, it is copied into the variable for use by your\nproxy.\n\nFor an example with code, see\n[Example: General purpose caching](/apigee/docs/api-platform/cache/optimize-performance-using-cache).\n\n### Managing cache with the Apigee API\n\nYou can list and delete caches using the\n[caches API](/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.caches).\n\nLong-term persistence with key value maps (KVMs)\n------------------------------------------------\n\nTo indefinitely store structured data either encrypted or unencrypted, you can create and\npopulate key value maps (KVMs) that contain arbitrary key/value pairs. For example, you might\nstore:\n\n- A map correlating IP addresses to country codes.\n- A list of IP addresses that are allowed/denied access.\n- A map correlating long URLs to shortened URLs.\n- Environment-specific data, such as quota counts and OAuth token expiration times.\n\nKVMs can have one of three scopes: organization, environment, apiproxy. For example, if\nkey/value pairs are to be used for all APIs in an organization, create a KVM at the organization\nscope; or if only a specific API proxy should have access to keys/values, create the KVM at the\napiproxy scope. For more information, see [Working with key value maps](/apigee/docs/api-platform/cache/key-value-maps).\n\nProperty sets\n-------------\n\nA *property set* is a custom collection of key/value pairs\nthat store data. API proxies can retrieve this data when they execute.\n\nTypically, you use property sets to store non-expiring data that shouldn't be\nhard-coded in your API proxy logic, such as configuration data. You can access property set data anywhere in a proxy where you\ncan access [flow variables](/apigee/docs/api-platform/fundamentals/introduction-flow-variables).\n\nA common use case for property sets is to provide values that are\nassociated with one environment or another. For example, you can\ncreate an environment-scoped property set with configuration values that are\nspecific to proxies running in your test environment, and another\nset for your production environment.\n\n\nFor more information, see [Using property sets](/apigee/docs/api-platform/cache/property-sets).\n\nKubernetes secrets\n------------------\n\n\n(Apigee hybrid only) If you are already using Kubernetes for secret management in a custom vault for sensitive\ndata, you might want to consider using [Kubernetes Secrets](https://kubernetes.io/docs/concepts/configuration/secret/).\nJust like with KVM data, you can access the Kubernetes secret data in API proxy flow variables.\nFor more information, see [Storing data in a Kubernetes secret](/apigee/docs/hybrid/v1.3/k8s-secrets)."]]