cancel
Showing results for 
Search instead for 
Did you mean: 

Was it cached or not?

Jump to solution

I am trialing V7 and the default set I am working with has a cache rule that does not cache files over a certain size.  I want it to cache any file (regardless of size) for a specific URL.  I created a new Rule Set that is applied is URL.Host matches the site and placed it above the default cache rule that does not cache large file sizes.  I then only put an enable cache rule in the specific ruleset.  Is this correct? How can I test to see if it actually caches a large file from this site?

0 Kudos
1 Solution

Accepted Solutions
dstraube
Level 11

Re: Was it cached or not?

Jump to solution

Hello,

your new rule set should work as expected. It will enable the cache, so big files will be cached. You can not directly see if something was stored in the cache, but you can see if something was received from it. So once the object is in the cache you can verify that by requesting the object again.

There are two ways to get this information:

  1. Add a new field to the access.log. The information if something is coming from the cache or not is stored in the property Cache.Status. TCP_MISS indicates it is not coming from the cache and TCP_HIT would show up if the file was delivered from the cache. Adding the field to the access.log would look like this:
    accesslog.jpg
    If you are using a log header you might want to alter that one too, so that the log format if complete. That's not shown in the picture here.
  2. With enabled web cache (almost) each HTTP header from the proxy to the client should contain an X-Cache Header that shows MISS or HIT. You need a network trace or a browser add-on that can display the response headers to see this information.

Please remember that not all content is cacheable. The webserver needs to send a header, indicating that a proxy can store this information (expire headers, e-tag, anything that a proxy can use to verify cacheable content). MWG will also not store dynamic content, so URL Parameters, responses to POST requests or cookie information in the request will all cause content to not be stored!

Regards,

Dirk

0 Kudos
3 Replies
dstraube
Level 11

Re: Was it cached or not?

Jump to solution

Hello,

your new rule set should work as expected. It will enable the cache, so big files will be cached. You can not directly see if something was stored in the cache, but you can see if something was received from it. So once the object is in the cache you can verify that by requesting the object again.

There are two ways to get this information:

  1. Add a new field to the access.log. The information if something is coming from the cache or not is stored in the property Cache.Status. TCP_MISS indicates it is not coming from the cache and TCP_HIT would show up if the file was delivered from the cache. Adding the field to the access.log would look like this:
    accesslog.jpg
    If you are using a log header you might want to alter that one too, so that the log format if complete. That's not shown in the picture here.
  2. With enabled web cache (almost) each HTTP header from the proxy to the client should contain an X-Cache Header that shows MISS or HIT. You need a network trace or a browser add-on that can display the response headers to see this information.

Please remember that not all content is cacheable. The webserver needs to send a header, indicating that a proxy can store this information (expire headers, e-tag, anything that a proxy can use to verify cacheable content). MWG will also not store dynamic content, so URL Parameters, responses to POST requests or cookie information in the request will all cause content to not be stored!

Regards,

Dirk

0 Kudos
McAfee Employee

Re: Was it cached or not?

Jump to solution

To generally understand how web caching works, this site contains a good introduction: http://www.mnot.net/cache_docs/#CONTROL

best,

michael

0 Kudos

Re: Was it cached or not?

Jump to solution

Works great, thanks for that.

0 Kudos