You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Vijay Shanker Dubey <vi...@gmail.com> on 2010/09/15 09:41:28 UTC

[users@httpd] Problem with mode_expires module

I am trying to enable cache on my apahce web server. I am using following
module for this purpose.

LoadModule expires_module modules/mod_expires.so

I have added following lines in my httpd.conf file to set set the expire
settings on the documents.

ExpiresActive On
ExpiresDefault "access plus 1 year"

By documentation, this should enable expiration on all the documents for one
years, In response headers returned by web server, there are expire header
and also cache control header with max-age attribute, But still when i
refresh the page, request goes to server to fetch the file.

I presume these files should be loaded from cache only. Can you point what i
might be missing?


Regards,
Vijay Shanker Dubey

Re: [users@httpd] Re: Problem with mode_expires module

Posted by "J. Greenlees" <li...@jaqui-greenlees.net>.
Vijay Shanker Dubey wrote:
> I am very Sorry joost; I will take care of that next time alway,
> 
> Regards,
> Vijay Shanker Dubey

~snip~
  when a resource is cached for the 1 year, it should not be
>>> asked
>>> for again till the time it is not expired.
>>>
>>> Is this right?
>> This is usually configurable in the browser.
>>
> 
> Can you please elaborate your statement please ?
> 

I clear my browser cache daily, and have my browser set to ALWAYS get 
the file from the server.
your caching will never stop handing me the files every time I access 
the server.

---------------------------------------------------------------------
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] Re: Problem with mode_expires module

Posted by Vijay Shanker Dubey <vi...@gmail.com>.
I am very Sorry joost; I will take care of that next time alway,

Regards,
Vijay Shanker Dubey



On Wed, Sep 15, 2010 at 3:00 PM, Joost de Heer <jo...@sanguis.xs4all.nl>wrote:

> On Wed, September 15, 2010 11:17, Vijay Shanker Dubey wrote:
>
> Please don't use HTML formatting in your mails, the yellow background is
> virtually unreadable on my screen.
>
> > That look like okay for me as with status code 304, there is no any
> > payload
> > in the http response, but again, what is the need for this server
> > round-trip, when a resource is cached for the 1 year, it should not be
> > asked
> > for again till the time it is not expired.
> >
> > Is this right?
>
> This is usually configurable in the browser.
>

Can you please elaborate your statement please ?


> Joost
>
> ---------------------------------------------------------------------
> 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] Re: Problem with mode_expires module

Posted by Joost de Heer <jo...@sanguis.xs4all.nl>.
On Wed, September 15, 2010 11:17, Vijay Shanker Dubey wrote:

Please don't use HTML formatting in your mails, the yellow background is
virtually unreadable on my screen.

> That look like okay for me as with status code 304, there is no any
> payload
> in the http response, but again, what is the need for this server
> round-trip, when a resource is cached for the 1 year, it should not be
> asked
> for again till the time it is not expired.
>
> Is this right?

This is usually configurable in the browser.

Joost

---------------------------------------------------------------------
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


[users@httpd] Re: Problem with mode_expires module

Posted by Vijay Shanker Dubey <vi...@gmail.com>.
One more finding, When caching is enabled for static files, following is the
behavior of the apache server : -

*For the first request to resource, *
Apache server responds with HTTP status code 200

Log message
127.0.0.1 - - [15/Sep/2010:14:17:33 +0530] "GET /test.html HTTP/1.1" 200 367
"-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100825
Ubuntu/10.04 (lucid) Firefox/3.6.9 GTB7.1"

For all other subsequent request

Apache server responds with HTTP status code 304

Log Message
127.0.0.1 - - [15/Sep/2010:14:17:38 +0530] "GET /test.html HTTP/1.1" 304 209
"-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100825
Ubuntu/10.04 (lucid) Firefox/3.6.9 GTB7.1"


That look like okay for me as with status code 304, there is no any payload
in the http response, but again, what is the need for this server
round-trip, when a resource is cached for the 1 year, it should not be asked
for again till the time it is not expired.

Is this right?

Regards,
Vijay Shanker Dubey



On Wed, Sep 15, 2010 at 1:11 PM, Vijay Shanker Dubey
<vi...@gmail.com>wrote:

>
>
> I am trying to enable cache on my apahce web server. I am using following
> module for this purpose.
>
> LoadModule expires_module modules/mod_expires.so
>
> I have added following lines in my httpd.conf file to set set the expire
> settings on the documents.
>
> ExpiresActive On
> ExpiresDefault "access plus 1 year"
>
> By documentation, this should enable expiration on all the documents for
> one years, In response headers returned by web server, there are expire
> header and also cache control header with max-age attribute, But
> still when i refresh the page, request goes to server to fetch the file.
>
> I presume these files should be loaded from cache only. Can you point what
> i might be missing?
>
>
> Regards,
> Vijay Shanker Dubey
>
>