tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary
ドキュメントCloud Object StorageUse CasesContent ModerationBlocking CDN Cache Based on Moderation Result

Blocking CDN Cache Based on Moderation Result

PDF
フォーカスモード
フォントサイズ
最終更新日: 2024-03-25 15:16:26

Overview

The content moderation feature can automatically block non-compliant files. It only applies to data stored on COS origins rather than data cached on CDN nodes.
This document describes how to promptly block non-compliant data cached in CDN through SCF and API Gateway.

Directions

1. Log in to the SCF console, select Functions, and click Create to create a function.
2. Select Create from scratch and set the following basic configuration items:
Function type: Select Event-triggered function.
Function name: Enter a custom function name.
Region: Select the region of the bucket with the moderation feature enabled.
Runtime environment: Select Python 2.7.
3. Configure the function code as follows:
Submitting method: Select Local ZIP file or Upload a ZIP pack via COS. You can download the ZIP package here.
Execution: Enter index.main_handler.
4. Click Advanced configuration to configure Environment configuration. You can modify all configuration items except the environment variables as needed.
Resource type: CPU
MEM: 512 MB
Initialization timeout period: 65
Execution timeout period: 30
Environment variable:
CI_AUDITING_CALLBACK: Enter the callback address configured in the callback settings of content moderation here. The callback will be performed only if the callback address is set.
CDN_URL: Set the required CDN address to purge the CDN cache.
REGION: Set the required region where the bucket resides.
BUCKET_ID: Set the required bucket ID (i.e., bucket name), which is used to query the image style. Entering an incorrect value will result in an error during style query.
IMAGE_STYLE_SEPARATORS: Set the image style separator if you want to purge image style. You can enter multiple separators consecutively with no need to separate them.
CDN_REFRESH_TYPE: Set the image object cache purge method, which is purge by URL by default (that is, only the style will be purged). If you set this variable to path, the cache accessed by image processing parameters will be purged. Note that purge by path will remove files with longer filenames containing this filename. Be sure to configure the above environment variables correctly so that cache purge can work as expected.
5. Select Execution Role for Permission configuration and click Create execution role to enter the Create custom role page.
6. Select Serverless Cloud Function (SCF) as the role entity and click Next.
7. Select the QcloudCDNFullAccess and QcloudCIReadOnlyAccess role policies and click Next.
8. Name the role and click Complete.
9. After creating the custom role, go back to the function creation page, refresh the role drop-down list, and select the newly created role.
10. Click Complete.
11. Go to the API Gateway console to activate the API Gateway service.
12. Create an API gateway as instructed in Creating APIs Connecting to the SCF Backend.
13. Select Publish for Release Environment and click Publish service.
14. On the content moderation page in the CI console, set callback parameters for image or other target types, and set the address of the API gateway created in the previous step as the callback URL.
15. After the callback is configured, resource cache in CDN will be automatically purged based on the moderation callback result.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック