---
title: 'Clear Cache with API'
url: 'https://docs.vinahost.vn/cdn/advanced/clear-cache-api'
markdown: 'https://docs.vinahost.vn/cdn/advanced/clear-cache-api.md'
date: '2026-09-30'
description: "Giới thiệu Tài liệu này hướng dẫn cách sử dụng API CDNetworks để xóa cache CDN theo tài liệu chính thức tại:\_API Explorer https://apiexplorer.cdnetworks.com/apiexplorer/overview Chuẩn bị 1. Thông tin xác thực Bạn cần có cặp khoá accessKey secretKey . Trong thông tin kích hoạt dịch vụ đã có hoặc bạ…"
taxonomy:
  category:
    - docs
  tag: {  }
---

[](#) [  Edit this Page](https://github.com/vinahost/documents.git/pages/09.CDN/07.advanced/04.clear-cache-api/docs.md%20) 

  [ VinaHost Documents ](https://docs.vinahost.vn/)     [ Dịch vụ CDN ](https://docs.vinahost.vn/cdn)     [ Hướng dẫn nâng cao ](https://docs.vinahost.vn/cdn/advanced)      Clear Cache with API    

# Clear Cache with API

## Giới thiệu

Tài liệu này hướng dẫn cách sử dụng API CDNetworks để xóa cache CDN theo tài liệu chính thức tại: [API Explorer](https://apiexplorer.cdnetworks.com/apiexplorer/sdk?apiId=4515&productType=all_product)https://apiexplorer.cdnetworks.com/apiexplorer/overview

## Chuẩn bị

### 1. Thông tin xác thực

Bạn cần có cặp khoá **accessKey** **secretKey** . Trong thông tin kích hoạt dịch vụ đã có hoặc bạn có thể liên hệ Kỹ thuật để hỗ trợ cung cấp hoặc tạo lại

### 2. Tạo request mẫu test xóa cache

Truy cập link sau: https://apiexplorer.cdnetworks.com/apiexplorer/sdk?apiId=4515&productType=all\_product ![](https://docs.vinahost.vn/user/pages/09.CDN/07.advanced/04.clear-cache-api/Screenshot_chrome_2025-12-08_14-30-01_1920px-919px.png)

![](https://docs.vinahost.vn/user/pages/09.CDN/07.advanced/04.clear-cache-api/Screenshot_chrome_2025-12-08_14-35-43_1920px-919px.png)

### 3. Tải code mẫu

![](https://docs.vinahost.vn/user/pages/09.CDN/07.advanced/04.clear-cache-api/Screenshot_chrome_2025-12-08_14-37-14_1920px-919px.png)

### 4. Cài thêm thư viện và thực hiện xoá cache

Sau khi tải về và Upload lên server, thực hiện chạy lệnh `composer install` để cài đặt một số thư viện cần thiết ![](https://docs.vinahost.vn/user/pages/09.CDN/07.advanced/04.clear-cache-api/Screenshot_MobaXterm_2025-12-08_15-18-51_1251px-911px.png)

Tiến hành thay thế `{accessKey}` và `{secretKey}` vào trong file Client.php

![](https://docs.vinahost.vn/user/pages/09.CDN/07.advanced/04.clear-cache-api/Screenshot_chrome_2025-12-08_15-20-29_1208px-793px.png)Bây giờ bạn có thể thực hiện xoá cache CDN bằng cách gọi file Client.php để thực hiện php Client.php hoặc truy cập đường dẫn đến file Client.php trên trình duyệt.

 [ ](https://docs.vinahost.vn/cdn/advanced/ip-blacklis-anti-hotlinking) [](https://docs.vinahost.vn/alibabacloud)

---

## Navigation

- Parent: [Hướng dẫn nâng cao](https://docs.vinahost.vn/cdn/advanced.md)
- Previous: [IP Blacklist Anti Hotlinking](https://docs.vinahost.vn/cdn/advanced/ip-blacklis-anti-hotlinking.md)
