How do I check for cached object and delete them selectively
search cancel

How do I check for cached object and delete them selectively

book

Article ID: 166007

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

Checking if a object is cached

Use the following syntax to check if an object is in cache:

https://<proxyip>:8082/CE/Info/<protocol name, e.g. http>/<url without the protocol specification, e.g. without http://>


Example:
To check if the following object is in the cache:
http://www.bluecoat.com/sites/default/themes/bc_pandemonium/css/docviewer.css

Enter the following in the browser:
https://1.2.3.4:8082/CE/Info/http/www.bluecoat.com/sites/default/themes/bc_pandemonium/css/docviewer.css

If the object is in the cache, you will obtain a table providing details on the cached object such as:

--------------------------------------------------------------
Located on disk 1
Time of most recent access 427,010,683 = 07/13/2009 06:04:43 UTC
Time of next to most recent access 0 = 01/01/1996 00:00:00 UTC
Time of most recent modifications 418,144,299 = 04/01/2009 15:11:39 UTC
....
....
--------------------------------------------------------------

If it's not in cache, you will obtain a message

--------------------------------------------------------------
Unable to locate object in cache; status = 0x00000007
--------------------------------------------------------------


Deleting 1 object in cache

Method 1: Using Browser

Use the following systax to delete an object in the cache:

https://<proxy ip>:8082/CE/Delete/<protocol name, e.g. http>/<url without the protocol specification, e.g. without http://>\

Example:

To delete the following object is in the cache:
http://www.bluecoat.com/sites/default/themes/bc_pandemonium/css/docviewer.css

Enter the following in the browser:
https://1.2.3.4:8082/CE/Delete/http/www.bluecoat.com/sites/default/themes/bc_pandemonium/css/docviewer.css

The following confirmation message will be returned:
http://www.bluecoat.com/sites/default/themes/bc_pandemonium/css/docviewer.css has been deleted successfully.

Deleting an object which does not exist in cache will return the following message:
Attempting to delete http://www.bluecoat.com/sites/default/themes/bc_pandemonium/css/docviewer.css resulted in a return status code of 0x00000007.


Method 2: Using CLI

MySG>en
Enable Password:
MySG#(config)
MySG#conf t
Enter configuration commands, one per line.  End with CTRL-Z.
MySG#(config)content delete url
http://www.bluecoat.com/sites/default/themes/bc_pandemonium/css/docviewer.css
  ok

This object is now deleted from cache. If I issue the same command again, the SG will return an error:

MySG#(config)content delete url http://www.bluecoat.com/sites/default/themes/bc_pandemonium/css/docviewer.css
% Object not found.
MySG#(config)

 


Selective deletion of multiple cached object using REGEX

If you want to delete multiple or groups of objects, the CLI provides an easy to achieve this:

In the example below, all objects which contains the string "css" in URL, URI or object name will removed. The command below will remove the object used in the example above from the cache

MySG>en
Enable Password:
MySG#conf t
Enter configuration commands, one per line.  End with CTRL-Z.
MySG#(config)content delete regex css
  ok
MySG#(config)

The example below will remove all objects in the cache associated with the regex "www.bluecoat.com"

MySG>en
Enable Password:
MySG#conf t
Enter configuration commands, one per line.  End with CTRL-Z.
MySG#(config)content delete regex
www.bluecoat.com
  ok
MySG#(config)

 

Resolution