HyperCache is designed to drive the proxy about objects that must be stored locally.
It basically enforce caching specific websites that use new technologies to provide objects.
Why driving the proxy ?
The proxy stores object by building a key calculated with the URL without parameters.
- http://mydomain.com/myfile.zip [GOOD] will be correctly stored in cache has /cache/00/09987657
- http://mydomain.com/download.php?id=98 [BAD]
Proxy will use http://mydomain.com/download.php for the key
- http://d1.mydomain.com/myfile.zip or http://d2.mydomain.com/myfile.zip [BAD]
Proxy will store 2 elements for d1.mydomain.com and d2.mydomain.com
Examples 2 and 3 is now the most used on Internet:
- Many websites use CMS Like Joomla, WordPress that stores pictures and files in a database.
- Big websites such as facebook, google, youtube… use CDN ( Content delivery Network ) that changes the URL every time.
HyperCache is able to modify the proxy behavior in order to help understand the example 2 and example 3.
This will increase dramatically the cache rate but require some time.
To use this feature, you have to :
- Understand Regex language
- Understand the target website structure ( CDN, uris, arguments )
Let us explain with a real website : www.saintjo.tv
In this website most of objects inside this website can be cached using the standard method:
These pictures can be stored on the cache easily.
On this website, there are some videos.
Videos are stored outside the saintjo.tv on the vod.121video.com website
Video fragments are stored on this way
Url is not correct for the proxy to stores fragments.
The first way is to create the regex pattern to detect some parts of the URL
Will catch these values:
With these values we can simplify the source URL to a new one more simple:
Not that finishing the domain by SQUIDINTERNAL is important to pass the URL into the cache enforcement.
- On Artica go into “Your Proxy“
- Choose HyperCache link.
- Choose rules tab
- Click on New rule
- Add the modified url in the “URL returned to the proxy” and the matching regex pattern in the “pattern” field
- Click on Apply button to make rules in production mode.