Re: apache caching not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



dd123 wrote:
You are right. My apache switched to different runtime user though it started
as root.
I changed the dir permission and atleast I can see some contents in the
cache dir
But now, I have hit another roadblock:

Basically, I want the images to be served via cache and my images are
distinguishable through query string
http://backend-server.abc.com/mcs-stream-war/asset/streamAsset?id=e98a887b-2eb1-456d-ba18-d21a1b0b345th

http://backend-server.abc.com/mcs-stream-war/asset/streamAsset?id=e98a887b-2eb1-456d-ba18-d21a1b0b456ft

http://backend-server.abc.com/mcs-stream-war/asset/streamAsset?id=e98a887b-2eb1-456d-ba18-d21a1b023wert


The problem is:  Apache caching solution is ignoring whatever is there in
the query string after ?.
It means that whatever value I send in the query string, I am always served
the first image.

How can force apache caching solution to recognize the query strings and
store images and its associated query string.


Snippet from error_log:


[Tue Jan 27 21:43:36 2009] [debug] mod_disk_cache.c(476): disk_cache:
Recalled cached URL info header
http://reverse-proxywebserver.abc.com:80/mcs-stream-war/asset/streamAsset?
[Tue Jan 27 21:43:36 2009] [debug] mod_disk_cache.c(749): disk_cache:
Recalled headers for URL
http://reverse-proxywebserver.abc.com:80/mcs-stream-war/asset/streamAsset?
[Tue Jan 27 21:43:36 2009] [debug] mod_cache.c(282): cache: running
CACHE_OUT filter
[Tue Jan 27 21:43:36 2009] [debug] mod_cache.c(296): cache: serving
/mcs-stream-war/asset/streamAsset
[Tue Jan 27 21:44:19 2009] [debug] mod_disk_cache.c(476): disk_cache:
Recalled cached URL info header
http://reverse-proxywebserver.abc.com:80/mcs-stream-war/asset/streamAsset?
[Tue Jan 27 21:44:19 2009] [debug] mod_disk_cache.c(749): disk_cache:
Recalled headers for URL
http://reverse-proxywebserver.abc.com:80/mcs-stream-war/asset/streamAsset?


Alexandru David Constantinescu wrote:
dd123 wrote:
I have a webserver servicing the images and url for that webserver looks
like
this:

http://backend-server.abc.com/mcs-stream-war/asset/streamAsset?id=e98a887b-2eb1-456d-ba18-d21a1b0b06cc

The above URL is basically an image.

Now, I want to front this webserver with a reverse proxy caching apache
webserver.  The reverse proxy part is workign good but it looks like the
caching is not working at all. I want to use disk based caching and my
config looks like this:

ProxyRequests off
ProxyPass /mcs-stream-war/asset/ http://backend-server.abc.com/mcs-stream-war/asset/ ProxyPassReverse /mcs-stream-war/asset/ http://backend-server.abc.com/mcs-stream-war/asset/


CacheRoot   /opt/apache2.2.11-mcs-caching/diskcache-store
CacheEnable disk /
CacheDirLevels 2
CacheDirLength 1
CacheMaxFileSize 100000000
CacheIgnoreCacheControl On
CacheIgnoreNoLastMod On
CacheIgnoreNoLastMod On
CacheMaxExpire 604800
CacheIgnoreQueryString On

Here are my observations and issues:

1) when I hit the given reverse proxy apache server with this url:
http://reverse-proxywebserver.abc.com/mcs-stream-war/asset/streamAsset?id=e98a887b-2eb1-456d-ba18-d21a1b0b06cc,
I can see that I am being served the image as the reverse proxy webserver
gets connection to the backend resource http://backend-server.abc.com/mcs-stream-war/asset/ and serves the image

2) But the caching part is not working at all. Nothing is being created
in
the caching directory at all.

Here are the debug error messages:


[Tue Jan 27 18:55:46 2009] [debug] mod_cache.c(131): Adding CACHE_SAVE
filter for /mcs-stream-war/asset/streamAsset
not cached. Reason: HTTP Status 304 Not Modified
[Tue Jan 27 18:57:08 2009] [debug] proxy_util.c(2009): proxy: HTTP: has
released connection for (backend-server.abc.com)



Please help me with this. My gut feeling is: I am missing some small
config..


Hi

Check permissions on your cache folder (apache user must be able to write in there)

alex


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




Hi, again

So , by using CacheIgnoreQueryString On you tell apache to serve from cache like ther is no query string (the same url every time). Try to disable this option. With this option Off , apache basically will make one file/query

Alex

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux