Skip to main content

Cloudfront Services List

Amazon CloudFront is a Content Delivery Network (CDN) service developed by Amazon Web Services (AWS). It is a global service that provides fast, high-quality access to static and dynamic content such as images, video, audio, web applications, and more. With CloudFront, users can improve web application performance and reduce latency and lag when accessing content from around the world. CloudFront also provides features such as access restriction, cache invalidation and more, which makes it easier to manage content that is delivered globally.

Cloudfront Distribution

Distribution IDNameURLEnvironmentDescription
E36LAJDAL24RPIFrontend Regulerhttps://arkademi.comProductionCaching Frontend (js, css & static asset)
E1EAY7M726VSXDAPI Course Regulerhttps://api-course.arkademi.comProductionCaching API Course Production Reguler (Endpoint)
E26SXYOKVA4KYJFrontend Prakerjahttps://prakerja.arkademi.comProductionCaching Frontend Prakerja (js, css & static asset)
E2C1RDXLBWIJW2API Course Prakerjahttps://prakerja-api-course.arkademi.comProductionCaching API Course Production Prakerja (Endpoint)
E2MRL01KR1LZUMStaging Frontend Regulerhttps://fe.arkademi.comProductionCaching Staging Frontend
E158P1A6YNKVSQStaging API Course Regulerhttps://apicourse2.arkademi.comStagingCaching Staging API Course Reguler
E2BR2HPB1W7JZJStaging API Course Prakerjahttps://stag-prakerja-apicourse-fgt.arkademi.comStagingCaching Staging API Course Prakerja
E26SXYOKVA4KYJFrotend Prakerja Staginghttps://stag-webinar.arkademi.comStagingCaching Staging Frontend Prakerja

API Behaviour

Within each Cloudfront Distribution there are several caching/non-caching behaviors that exist. Here below is how to see what behaviors are present in the API:

  1. Click the distribution ID.
  2. It will redirect to the General Tab page. general tab
  3. Then move it to the Behaviors tab. general tab
  4. Cloudfront does caching based on the URI/Endpoint/path of the API as shown above. It can be viewed in more detail by clicking the Edit button. detail
  5. In the path pattern, you can input specific Endpoint/path or General (by using * as a wildcard) with the example /api/v1/course/* which means that each Endpoint /api/v1/course/12345 or /api/v1/course/54321 will be cached. Then you can set Redirect HTTP to HTTPS, and Allow HTTP Methods that are benign to be cached. endpoint
  6. Next, scroll down to the cache key and origin requests section. You can input specific headers to be cached, such as Origin, Host, etc. If you want to set how long the caching will last, then you can select the customize option then specify how long the caching will be kept (in seconds). For the path /api/v1/course/*, it will be cached for about 86400 seconds or about 24 hours until cloudfront will make another request to the origin. customize
  7. If there are changes from the Developer after deployment, then there is a cached path, you don't have to wait 24 hours for the data to be updated. This can be resolved by performing invalidation (clear cache), and to do this, go to the invalidation tab as illustrated below. invalidation page
  8. To do Invalidation, you can click the Create Invalidation button. create invalidation
  9. Then enter the path you want to clear the cache, for example /api/v1/course/12345 as below, then submit by clicking the Create Invalidation button. submit invalidation
  10. It takes some time to process invalidate, so please wait until the status becomes completed. 10_1 10_2
  11. If you don't know which path you want to clear cache, you can do it by utilizing the wildcard * as shown below. wildcard
  12. To see whether the caching is working in the browser, you can see it through the inspect element. inspect element

Notes

On the

https://api-course.arkademi.com/api/v1/course/founder-class-mendirikan-startup-dan-cara-membagi-saham/detail

path, is included in the cached path because there is a caching behavior in it, i.e. : /api/v1/course/*