You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by srinivasch <sr...@gmail.com> on 2008/11/26 20:06:08 UTC

[users@httpd] Need help in configuring caching of frequently downloaded file.

Hi

  I need some help in configuration or some snippet to help me in
configuring my apache web server to cache frequently downloaded non static
file from my application. each file has a different ID. I am totally new to
this apache configuration, any help provided is deeply appreciated.

Thanks
S
-- 
View this message in context: http://www.nabble.com/Need-help-in-configuring-caching-of-frequently-downloaded-file.-tp20707117p20707117.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Need help in configuring caching of frequently downloaded file.

Posted by Eric Covener <co...@gmail.com>.
On Mon, Dec 1, 2008 at 10:35 AM, srinivasch <sr...@gmail.com> wrote:
>
> Hi Eric,
>
>  As of now I have done nothing, just going through the documentation
> whether it can be done, I posted here if anyone has already done this. That
> is my URL construct and its not from a form submission, its from view record
> where there is a link to download the file and the URL of that would be the
> one I provided. What I should be looking at to configure my apache.
> Appreciate your time in replying to my question.

I linked to the caching guide in the previous response, that'd be the
first place to look.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Need help in configuring caching of frequently downloaded file.

Posted by Wii Sale <sa...@gmail.com>.
Thanks a lot for your response. I would go through the documentation and
would try my best.

On Mon, Dec 1, 2008 at 11:02 AM, André Warnier <aw...@ice-sa.com> wrote:

> Ok, now it is a bit clearer.
> You really need to read the series of earlier messages I mentioned earlier.
>  The basic case is very similar to yours.
>
> Thus, you have an Apache front-end, and a Tomcat back-end.
> The Tomcat back-end is the one that produces the answers, which are
> generally large PDF documents.
> You would like that the Apache front-end caches the responses from Tomcat,
> so that if another request comes for the same URL within a certain
> timeframe, it is Apache that will serve the PDF document from its local
> cache, rather than passing the request again to Tomcat and forcing Tomcat to
> produce the same big PDF document again.
>
> For that, you need to set up mod_cache at the Apache level.
> You also need to make sure that Tomcat, when it delivers a response,
> indicates in the response the timeframe for which this same response is
> valid.  That means that it needs to set a HTTP header like "Expires".
>
> Once you do that, Apache and mod_cache will take care of it nicely and
> automatically, and even your Apache host's operating system disk cache will
> help.
>
> I suggest that, for a start, you read the Apache 2.2 documentation for
> "content caching" (on the main documentation page).  That will tell you a
> lot about such HTTP headers and how mod_cache handles them.
> Then, when you have read it and understood it, try out something, and come
> back here for more questions if you have any.
>
>
>
> srinivasch wrote:
>
>> I am sorry if my question is vague. Anyways YES you are right we already
>> have
>> an application which runs on tomcat and Apache web server. The PDF
>> documents
>> I mentioned are big and they need to be retrieved everytime from database
>> whenever user requests, and we have quite a volume of users and their
>> requests for these documents hence we thought of caching these frequently
>> requested/downloaded pdf documents and the less frequent ones are either
>> flushed out of cache and the ones which are not requested should not be
>> cached.
>>
>>         I hope I made some sense.
>>
>>
>>
>> awarnier wrote:
>>
>>> srinivasch wrote:
>>> [...]
>>> Hi.
>>>
>>> The problem is, your question is so vague that it is difficult to give
>>> you any precise response.
>>>
>>> You may benefit from reading the messages of one of the previous threads
>>> on this same list, the ones with the subject :
>>> Clearing cache selectively on Apache + mod_cache
>>>
>>> That may give you some clues to start with.
>>>
>>>  From your initial post, I kind of guess that you already have an
>>> application running under Apache, and that it delivers content which are PDF
>>> documents.  Is that correct ?
>>> If it is, then can you explain why you want to cache this content ?
>>> It is not quite clear from your initial post why you would want to do
>>> that, considering this seems to be dynamic content anyway.
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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@httpd.apache.org
>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Need help in configuring caching of frequently downloaded file.

Posted by André Warnier <aw...@ice-sa.com>.
Ok, now it is a bit clearer.
You really need to read the series of earlier messages I mentioned 
earlier.  The basic case is very similar to yours.

Thus, you have an Apache front-end, and a Tomcat back-end.
The Tomcat back-end is the one that produces the answers, which are 
generally large PDF documents.
You would like that the Apache front-end caches the responses from 
Tomcat, so that if another request comes for the same URL within a 
certain timeframe, it is Apache that will serve the PDF document from 
its local cache, rather than passing the request again to Tomcat and 
forcing Tomcat to produce the same big PDF document again.

For that, you need to set up mod_cache at the Apache level.
You also need to make sure that Tomcat, when it delivers a response, 
indicates in the response the timeframe for which this same response is 
valid.  That means that it needs to set a HTTP header like "Expires".

Once you do that, Apache and mod_cache will take care of it nicely and 
automatically, and even your Apache host's operating system disk cache 
will help.

I suggest that, for a start, you read the Apache 2.2 documentation for 
"content caching" (on the main documentation page).  That will tell you 
a lot about such HTTP headers and how mod_cache handles them.
Then, when you have read it and understood it, try out something, and 
come back here for more questions if you have any.


srinivasch wrote:
> I am sorry if my question is vague. Anyways YES you are right we already have
> an application which runs on tomcat and Apache web server. The PDF documents
> I mentioned are big and they need to be retrieved everytime from database
> whenever user requests, and we have quite a volume of users and their
> requests for these documents hence we thought of caching these frequently
> requested/downloaded pdf documents and the less frequent ones are either
> flushed out of cache and the ones which are not requested should not be
> cached.
> 
>          I hope I made some sense.
> 
> 
> 
> awarnier wrote:
>> srinivasch wrote:
>> [...]
>> Hi.
>>
>> The problem is, your question is so vague that it is difficult to give 
>> you any precise response.
>>
>> You may benefit from reading the messages of one of the previous threads 
>> on this same list, the ones with the subject :
>> Clearing cache selectively on Apache + mod_cache
>>
>> That may give you some clues to start with.
>>
>>  From your initial post, I kind of guess that you already have an 
>> application running under Apache, and that it delivers content which are 
>> PDF documents.  Is that correct ?
>> If it is, then can you explain why you want to cache this content ?
>> It is not quite clear from your initial post why you would want to do 
>> that, considering this seems to be dynamic content anyway.
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>>
> 


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Need help in configuring caching of frequently downloaded file.

Posted by srinivasch <sr...@gmail.com>.
I am sorry if my question is vague. Anyways YES you are right we already have
an application which runs on tomcat and Apache web server. The PDF documents
I mentioned are big and they need to be retrieved everytime from database
whenever user requests, and we have quite a volume of users and their
requests for these documents hence we thought of caching these frequently
requested/downloaded pdf documents and the less frequent ones are either
flushed out of cache and the ones which are not requested should not be
cached.

         I hope I made some sense.



awarnier wrote:
> 
> srinivasch wrote:
> [...]
> Hi.
> 
> The problem is, your question is so vague that it is difficult to give 
> you any precise response.
> 
> You may benefit from reading the messages of one of the previous threads 
> on this same list, the ones with the subject :
> Clearing cache selectively on Apache + mod_cache
> 
> That may give you some clues to start with.
> 
>  From your initial post, I kind of guess that you already have an 
> application running under Apache, and that it delivers content which are 
> PDF documents.  Is that correct ?
> If it is, then can you explain why you want to cache this content ?
> It is not quite clear from your initial post why you would want to do 
> that, considering this seems to be dynamic content anyway.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Need-help-in-configuring-caching-of-frequently-downloaded-file.-tp20707117p20774483.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Need help in configuring caching of frequently downloaded file.

Posted by André Warnier <aw...@ice-sa.com>.
srinivasch wrote:
[...]
Hi.

The problem is, your question is so vague that it is difficult to give 
you any precise response.

You may benefit from reading the messages of one of the previous threads 
on this same list, the ones with the subject :
Clearing cache selectively on Apache + mod_cache

That may give you some clues to start with.

 From your initial post, I kind of guess that you already have an 
application running under Apache, and that it delivers content which are 
PDF documents.  Is that correct ?
If it is, then can you explain why you want to cache this content ?
It is not quite clear from your initial post why you would want to do 
that, considering this seems to be dynamic content anyway.




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Need help in configuring caching of frequently downloaded file.

Posted by srinivasch <sr...@gmail.com>.
Hi Eric,

  As of now I have done nothing, just going through the documentation
whether it can be done, I posted here if anyone has already done this. That
is my URL construct and its not from a form submission, its from view record
where there is a link to download the file and the URL of that would be the
one I provided. What I should be looking at to configure my apache.
Appreciate your time in replying to my question.



Eric Covener wrote:
> 
> On Mon, Dec 1, 2008 at 8:20 AM, srinivasch <sr...@gmail.com> wrote:
>>>   I need some help in configuration or some snippet to help me in
>>> configuring my apache web server to cache frequently downloaded non
>>> static
>>> file from my application. each file has a different ID. I am totally new
>>> to this apache configuration, any help provided is deeply appreciated.
>>>
>>> Also the url will be something like this which downloads the pdf file.
>>> Appreciate your quick help.
>>>
>>> http://testg.org/intn4/download.action?fTId=159501
> 
> What have you tried, and what happened?
> 
> http://httpd.apache.org/docs/2.2/caching.html
> 
> If the URL included a query string (e.g. from a HTML form GET method)
> it will not be cached unless the response includes an "Expires:"
> header, as per RFC2616 section 13.9.
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Need-help-in-configuring-caching-of-frequently-downloaded-file.-tp20707117p20774243.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Need help in configuring caching of frequently downloaded file.

Posted by Eric Covener <co...@gmail.com>.
On Mon, Dec 1, 2008 at 8:20 AM, srinivasch <sr...@gmail.com> wrote:
>>   I need some help in configuration or some snippet to help me in
>> configuring my apache web server to cache frequently downloaded non static
>> file from my application. each file has a different ID. I am totally new
>> to this apache configuration, any help provided is deeply appreciated.
>>
>> Also the url will be something like this which downloads the pdf file.
>> Appreciate your quick help.
>>
>> http://testg.org/intn4/download.action?fTId=159501

What have you tried, and what happened?

http://httpd.apache.org/docs/2.2/caching.html

If the URL included a query string (e.g. from a HTML form GET method)
it will not be cached unless the response includes an "Expires:"
header, as per RFC2616 section 13.9.

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Need help in configuring caching of frequently downloaded file.

Posted by srinivasch <sr...@gmail.com>.
Anyone please help



srinivasch wrote:
> 
> Hi
> 
>   I need some help in configuration or some snippet to help me in
> configuring my apache web server to cache frequently downloaded non static
> file from my application. each file has a different ID. I am totally new
> to this apache configuration, any help provided is deeply appreciated.
> 
> Also the url will be something like this which downloads the pdf file.
> Appreciate your quick help.
> 
> http://testg.org/intn4/download.action?fTId=159501
> 
> Thanks
> S
> 

-- 
View this message in context: http://www.nabble.com/Need-help-in-configuring-caching-of-frequently-downloaded-file.-tp20707117p20771803.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org