Browser Cache Rule
The Browser Cache Rule feature in the Medianova Cloud Panel for dynamic content allows you to define caching behavior for dynamically generated resources. This feature helps optimize content delivery for dynamic content, reduce load times, and ensure that content is always up-to-date or efficiently cached for better performance.
Key Features
Flexible Cache Type Options:
All Files: This rule applies to all dynamic files, regardless of their type or location. It can be useful when you want to apply caching behavior globally to all dynamic resources.
Full Path: Apply the caching rule based on the exact full URL path of the dynamic content. This allows for fine-tuned control over specific dynamic URLs.
Directory: Apply the caching rule to all dynamic content within a specific directory. This is useful when dynamic content is organized by folder.
File Extension: Apply caching rules based on the file extension (e.g.,
.json
,.html
,.php
). This is particularly useful when dynamic content is served as JSON, HTML, or other formats.
Cache Priority: Set priorities for dynamic resources to control which resources are cached first. For example, prioritize critical dynamic content (e.g., personalized data, user-specific content) over less important content to improve user experience.
Cache Mode Options:
Origin: Dynamic resources are fetched and cached directly from the origin server, ensuring that content is always up-to-date.
No Cache: The dynamic resource will not be cached in the browser and will always be fetched from the origin server. This ensures that the latest dynamic content is always served, but can increase load times.
Cache: The dynamic resource is cached in the browser for the specified duration. This improves performance for subsequent requests but ensures that content is refreshed after the cache expiration time.
Apply to HTML/JSON Files:
On: The caching rule will apply to HTML and JSON files that contain dynamic content, allowing you to fine-tune caching behavior for these specific resource types.
Off: The caching rule will not apply to HTML and JSON files, ensuring they are always fetched fresh from the origin server.
By configuring Browser Cache Rules for dynamic content, you can optimize content delivery for both performance and freshness, ensuring that dynamic resources are efficiently cached or fetched in a way that best meets your application's needs.
How to Configure Browser Cache Rule
Click on the CDN Resources section in the left-hand menu of the Cloud panel.
Select the relevant resource.
Click on the Caching tab.
Navigate to the Browser Cache Rule section in the Medianova Cloud Panel.
Click on the Add button to create a new cache rule.
Configure Cache Rule Settings:
Type: Choose the type of cache rule you want to apply:
All Files: Applies to all files.
Full Path: Applies to files based on their exact URL path.
Directory: Applies to all files within a directory.
File Extension: Applies based on file extensions like
.js
,.css
,.jpg
, etc.
Priority: Set the priority (e.g., High, Medium, Low) for this cache rule to manage which files are cached first.
Cache Mode: Select the cache mode:
Origin: The resource is cached from the origin server.
No Cache: The resource is not cached.
Cache: The resource is cached in the browser for a set duration.
Apply the HTML/JSON Files:
On: Enable this option to apply the rule to HTML and JSON files.
Off: Disable this option to exclude HTML and JSON files from this cache rule.
Once you've configured the browser cache rule, click Submit to apply the changes.
By configuring the Browser Cache Rule, you can control how different file types are cached, ensuring that critical resources are loaded faster and less important resources are handled according to your specifications. The option to apply or not apply to HTML/JSON files provides further flexibility in caching strategies.
Last updated