|
Home > Archive > Apache Server configuration support > November 2006 > using mod_cache to cache everything to view page offline
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
using mod_cache to cache everything to view page offline
|
|
| andrew 2006-11-22, 7:23 pm |
| Hi,
I'm using mod_cache and mod_proxy with apache 2.2 as a forward proxy
cache. I want to be able to allow a user to view a website and have it
all cached, so if there connection was lost they would still be able to
browse. I have been partly successful in achieving this. At the moment
only some of the images are retrieved from the cache, while others are
not. Is there anything I can do to tell apache to simply cache
everything?
thanks
This is part of my httpd.conf file:
#####################################
<IfModule mod_cache.c>
LoadModule disk_cache_module modules/mod_disk_cache.so
<IfModule mod_disk_cache.c>
CacheRoot c:/cacheroot
CacheEnable disk http://www.apache.org/
CacheEnable disk /test
CacheDirLevels 5
CacheDirLength 3
</IfModule>
</IfModule>
CacheMaxFileSize 1000000000000
CacheIgnoreCacheControl On
CacheIgnoreNoLastMod On
CacheMaxExpire 6048000000
CacheStoreNoStore On
CacheStorePrivate On
| |
| shimmyshack 2006-11-22, 7:23 pm |
| you can tell the user agent to cache but will it obey those headers? my
guess is not always.
At the moment you are concentrating on mod_cache - telling apache to
cache things, which is slightly different from telling the user agent,
but some of the lines are also sending the right headers to your users.
How about using this:
LoadModule expires_module modules/mod_expires.so
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif A86400
ExpiresByType image/png A86400
ExpiresByType image/jpeg A86400
ExpiresByType text/css A86400
ExpiresByType application/x-javascript A86400
</IfModule>
OR for everything:
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault A604800
</IfModule>
this would go inside a virtual host stanza and tells apache to send
caching headers to the browser, it works with html and images.
Remember cookies have any effect if the page you return is from the
browsers cache. so say your application changes state, and sets a
cookie on the client, and then you click on a link which ahs been
cached, firefox for instance wont even request the new page.
Internet Explorer 6 suffered from the infamous rollover bug, which came
as a result of a default setting in IE6, tools->internet
options->settings->automatically
instead set it to something else and caching might then work again,
perhaps "never" is a better solution.
| |
| andrew 2006-11-23, 1:30 am |
| Thanks for that, it helped
|
|
|
|
|