Main Menu

News:

Please be aware of the Forum Rules of Conduct.

Help me cache

Started by Tom, January 09, 2012, 10:07:55 AM

Previous topic - Next topic

Tom

For some reason, the images, javascript, etc. of the new dynamic map are not being cached. That is what makes it slow.

Someone who knows the ins and outs of headers, pragma directives, apache, etc. - can you take a look at it and tell me why? I thought I had set up everything correctly.


Anaris

Well, I'm afraid I know very little about cacheing.  However, I can read headers, and report what I see, in case this is of any help ;D

When I load the new dynamic map, Apache is returning "304 Not Modified", but I'm still downloading the entire set of images. Here's what Safari reports about the headers:


Request URL:http://maps.battlemaster.org/Beluaterra/3/2/2.png
Request Method:GET
Status Code:304 Not Modified
Request Headers
Cache-Control: max-age=0
If-Modified-Since: Wed, 28 Dec 2011 18:07:00 GMT
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7
Referer: http://battlemaster.org/dynamicmap_mini.php?ShowRegion=165.php

Response Headers
Date: Mon, 09 Jan 2012 18:06:16 GMT
Connection: Keep-Alive
Server: Apache/2.2.16 (Debian)
Cache-Control: max-age=604800
Keep-Alive: timeout=10, max=100
Expires: Mon, 16 Jan 2012 18:06:16 GMT
Timothy Collett

"The only thing you can't trade for your heart's desire...is your heart." "You are what you do.  Choose again, and change." "One of these days, someone's gonna plug you, and you're going to die saying, 'What did I say? What did I say?'"  ~ Miles Naismith Vorkosigan

egamma

Maybe change the max-age=0 to max-age=1?

Anaris

Quote from: egamma on January 09, 2012, 07:13:08 PM
Maybe change the max-age=0 to max-age=1?

Far as I can tell, that part is what I'm sending the server.
Timothy Collett

"The only thing you can't trade for your heart's desire...is your heart." "You are what you do.  Choose again, and change." "One of these days, someone's gonna plug you, and you're going to die saying, 'What did I say? What did I say?'"  ~ Miles Naismith Vorkosigan