You are hereHow to configure VideoCache?
New version 1.9.2 of Videocache has added support for new URLs/domains being used by Youtube and Metacafe to serve videos. 1.9.2 performs much better as compared to all previous versions and will not eat up your CPU :-) Proceed to right now and enjoy caching. See notes about 1.9.2 here.
How to configure VideoCache?
Configuring Videocache is very easy. The configuration file for videocache is normally located at /etc/videocache.conf . Below is a brief explanation of different options used in videocache.conf .
Warning: If you change options in this file, please use the to update the videocache installation and reload apache web server and restart squid proxy server.
Click on the option name to get the details.
enable_video_cache
- This option controls the global behavior of videocache plugin. If it is 0, videocache will stop caching or serving anything. This option’s value can be either 0 or 1.
- Default Value : 1
cache_host
- The hostname or IP address of the system on which caching is being done. This is used for serving the videos from the cache.
- Please don’t use http:// or slashes (/). Just specify the domain name or IP address.
- Additionally you can select an alternative port to use. Example: 192.168.36.204:81
- Example : proxy.example.com
- Default Value : 127.0.0.1
- Note : Please change this to actual IP address or domain name of your proxy server, otherwise videocache will not work properly.
proxy
- Proxy to be used for downloading and caching videos via http. Normally proxy server will be the same as cache_host.
- Example : http://proxy.example.com:3128/
- Default Value : http://127.0.0.1:3128/
- Note : Please change this to actual IP address or domain name and port of your proxy server, otherwise videocache will not work properly.
proxy_username
- If the above proxy requires authentication, please specify the username.
- Default Value : <blank>
proxy_password
- If the above proxy requires authentication, please specify the password.
- Default Value : <blank>
hit_threshold
- No of times a video should be requested before we start caching it.
- Default Value : 1
base_dir
- Base directories for caching the videos. You can specify multiple caching directories here separated by '|' symbol along with their sizes. Size of directories are in Mega Bytes. Don't append M or MB.
EXAMPLE 1: To keep /videocache1 with size 700MB and /videocache2 with size 2GB as your cache directories, set base_dir to
base_dir = /videocache/ : 700 | /videocache2:2048EXAMPLE 2: To keep /videocache1 with unlimited storage and /videocache2 with 2GB as your cache directory, set base_dir to
base_dir = /videocache/ | /videocache2/:2048
OR
base_dir = /videocache/:0 | /videocache2/:2048
ZERO size specifies unlimited storage. Please try to avoid special characters in directory names like spaces, $ etc. - Default Value : /var/spool/videocache/
disk_avail_threshold
- This option sets the minimum available free space in Mega Bytes that is left in a partition containing a cache directory before videocache treats that partition as FULL.
EXAMPLE: If disk_avail_threshold = 200, videocache will stop caching videos in a cache directory if the free space available in a partition containing that cache directory is less than 200 Mega Bytes. - Default Value : 100
temp_dir
- Directory to store partially downloaded videos. Directory name is relative to base_dir.
- Default Value : tmp
max_parallel_downloads
- The maximum number of parallel downloads allowed. If all connections are consumed, videos will be queued for download.
- Default Value : 30
enable_videocache_cleaner
- Enables the videocache cleaner script which will remove videos from cache which have not been used since long. The value of this option can be 0 or 1.
- Default Value : 1
video_lifetime
- The maximum life of a video in cache without being used. If the video was not accessed for more than 'video_lifetime' days, it'll be removed from the cache. The unit of video_lifetime is days.
- Default Value : 60
logdir
- File where videocache logs will be stored.
- Default Value : /var/log/videocache/
max_logfile_size
- Maximum size of a logfile. The size is in mega bytes.
- Note: Please don’t use max_logfile_size = 10MB. Don’t append MB.
- Default Value : 10
max_logfile_backups
- The logfiles are automatically rotated once they have exceeded the max_logfile_size. max_logfile_backups is the number of backup files you want to keep. e.g. max_logfile_backups = 2 will keep videocache.log and videocache.log.1 and videocache.log.2 as logfiles.
- Default Value : 10
rpc_host
- XMLRPC Server is used for memory sharing across different instances of videocache. Leave these settings as it is if you don’t have a fair idea of XMLRPC.
- Default Value : 127.0.0.1
rpc_port
- Please make sure this port is not currently in use. If it is in use by some other program, change this to some port above 4096 which is not in use by any other program.
- Default Value : 9100
enable_youtube_cache
- This option enables the caching of youtube videos. This option’s value can be either 0 or 1.
- Default Value : 1
youtube_cache_dir
- Directory to cach youtube videos. Directory name is relative to base_dir. e.g. if you specify youtube_cache_dir = youtube, actual path for caching youtube videos would be /var/spool/videocache/youtube/ .
- Default Value : youtube
max_youtube_video_size
- Youtube videos with size more than max_youtube_video_size will not be cached. This size is in kilo bytes. Use 0 for unlimited caching. e.g. max_youtube_video_size = 10000. Only videos with size less than 10MB (10000KB) will be cached.
- Note: Don’t use max_youtube_video_size = 10000KB. Don’t append KB.
- Default Value : 0
min_youtube_video_size
- Youtube videos with size less than min_youtube_video_size will not be cached. This size is in kilo bytes. Use 0 for no lower limit. e.g. min_youtube_video_size = 10. Only videos with size more than 10KB will be cached.
- Note: Don’t use min_youtube_video_size = 10KB. Don’t append KB.
- Default Value : 0
All other options are similar to the above explained options.

