User → CDN edge → User
with uncached—User → CDN edge → Origin → CDNedge → User
. In the second case, more requests go to the origin, which causes longer response time simply due to a higher distance and more hops in the sequence.
curl -I
command; for instance:
How to request content from the same server
Value | Meaning |
---|---|
Cache-Control: max-age=0 | This value prohibits content caching. It may cause an issue with the Cache hit ratio and reduce performance. However, in some cases, this value is fine. |
Cache-Control: no-cache | This value prohibits content caching. It may cause an issue with the Cache hit ratio and reduce performance. However, in some cases, this value is fine. |
Cache-Control: no-store | This value prohibits content caching. It may cause an issue with the Cache hit ratio and reduce performance. However, in some cases, this value is fine. |
Cache-Control: private | This value caches content only in users’ browsers, not in the edge servers’ cache. Note: If the request contains custom headers starting with X (for example, X-custom-header), the CDN will treat the request as a new request and forward it to the origin (as with cookies). |
Cache: MISS | This value specifies that the response is received from the origin, bypassing the cache. Gcore’s CDN caches files on the first request. This means that the first request for a file will result in MISS (CDN had to reach the origin to pull the resource and cache it locally), and every subsequent request for the same file will result in HIT (served from a local CDN cache). |
Cause | Solution |
---|---|
Traffic started less than two days ago, and more cache needs to be collected. | Traffic patterns and amounts dictate how long you should wait to populate the cache. Usually, waiting for around 48 hours after the CDN integration is enough to cache most resources, but the exact time is individual. You can also deliver more content through CDN. |
Content is not requested enough, and the cache per server is low. | Increase the traffic to your content or use the paid Origin shielding option to accumulate requests. |
A “Cache-Control” value prohibits the CDN from caching content. | Ensure that the CDN Caching option is enabled and configured correctly.
|
Responses contain query strings or a Set-Cookie header, so the files are cached as different. | Enable Ignore Query String and Ignore Set Cookie options. Then, a single file will be delivered from the cache, regardless of the request parameters and the Set Cookie header. |
The Vary header is set on origins so that content is cached suboptimally. | Change the Vary header settings on your origin or use the Hide response headers feature in the customer portal. Set “Hide only,” select the Vary header and others that are necessary, then save changes. ![]() |