Not serving current documents

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Not serving current documents

Postby startd » 07. October 2010 15:54

I am running a Drupal site on a windows server. I have turned off IIS and installed Xampp. The website works great and all is well except for when a webmaster in our organization uploads a document. We do a daily publication. I have the webmasters just FTP the file up and overwrite the old one. That way the link does not have to be updated. When people who have visited that document before see the old document. They have to clear cookies and temp int files to see the new one.

What is the issue? I have mod expire turned on in Apache. Can anyone help. This is real inconvenient for my users. I know it is something simple I am overlooking.
startd
 
Posts: 12
Joined: 10. March 2010 20:06
Operating System: Windows Server 2008 R2 SP2

Re: Not serving current documents

Postby JonB » 07. October 2010 23:14

You need to force a no-cache -

That is when the browser reads the page, it does not add the page to its local cache (nor will any proxy servers). So the next time your site is visited and that page is requested, a fresh copy will always be obtained (the broswer doesn't have a cached copy). This info is embedded in the document head - speaking of the HTML DOM (the HTTP header info)

look at this link:

http://stackoverflow.com/questions/1207 ... -a-webpage

look for
There are several options to achieve this First In the section add meta tag:

<meta http-equiv="pragma" content="no-cache" />


There is also the HTML 1.1 meta tag "expires", but is is deprecated in favor of pragma no-cache

a full list is here:
http://www.metatags.org/meta_http_equiv

read the W3c section on cache control here:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Its hard to say where that need to be embedded, as you haven't described how the document fits into the site, BUT what every container holds the document is the çorrect' amswer.


Good Luck
:)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Not serving current documents

Postby startd » 08. October 2010 14:13

The document is a PDF. I have created a link on a page to point to doc1.pdf so the path is www.mysite.com/mydepartment/files/doc1.pdf. When that document is updated I have the users not change the name and just upload via FTP to the site. It asks do you want to replace and they say yes. I dont see where the HTTP headers would be in a .pdf document. Should it be something in the ftp folder or in the site files itself? Seems like it would be an apache setting.
startd
 
Posts: 12
Joined: 10. March 2010 20:06
Operating System: Windows Server 2008 R2 SP2

Re: Not serving current documents

Postby JonB » 08. October 2010 16:04

uhhh - nope -- protocol soup mix.

FTP has no such concept, (and it wouldn't be part of Apache then either - would it?) Apache isn't really serving that document EXCEPT when a page links to it. Then Apache looks to see if it is configured to serve pdf documents - that's the MIME thing (IF .pdf is a defined mime type and of what type it is.) PDF is an application type. Apache then tells the browser the type of helper that is needed. Webservers can't render .pdf files, so its either find an installed helper app or prompt to save if the helper is not found. Apache only gets requests from browsers or 'things' (applications) that use the HTTP specification to 'act as a browser' (like web-crawlers and content-miners). When you do an FTP interaction with that file, only the FTP server (and the FTP client) are aware of it - not Apache, as there was never an HTTP request.

(Browsers can act as FTP clients - but only when a URL begins with ftp:// -- and that will rely on the presence of an FTP server on the host)

Mime types for Apache are defined in \apache\conf\mime.types

There is a solution, use a script that enumerates the pdf files in the folder and creates links for them. Bingo end of problem. They now can name the files whatever they choose, add or delete them and there will always be a link. You could even include things like the date/time and size.

Good Luck
8)


ysf
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 34 guests