Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Cache-Control
Previous Previous
 
Next Next
New Post 4/30/2007 12:00 PM
User is offline Matthew Richards
8 posts
10th Ranked


Cache-Control 

I'm trying to develop a module that allows users to search, store metadata, upload and retrieve documents (files of all types) from the database.  It works fine, except when the user attempts to "Open" the document in a separate application (not inline with the browser).  The application displaying the document (acrobat or word, for example) will return an error that the file can't be found after it's downloaded from the module.  I verified the file doesn't exist in the temporary internet files.  If the user saves the file or if I change the Content-Disposition from application to inline, the file is saved or displayed correctly.  After searching for a solution to this, I found a KB article at Microsoft explains Cache-Control and why I can't open a document with Cache-Control set to Private or no-cache.  This makes sense, I don't want my bank account information stored in my temporary internet files.  When I try adding any of the following lines, as suggested by the KB article, and use an HTTP Logger, the result is always setting the Cache-Control to no-cache.

Response.AppendHeader("Pragma", "Public")
Response.AppendHeader("Cache-Control", "Public") 
or

Response.AppendHeader("Pragma", "")
Response.AppendHeader("Cache-Control", "") 

Is DotNetNuke overriding my settings when the page is rendered?  Has anyone experienced this?  Any help would be greatly appreciated.

Thanks,

Matt


Matthew Richards
US Army Engineering Research and Development Center
 
New Post 8/26/2007 4:19 AM
User is offline tudordumitriu
4 posts
10th Ranked


Re: Cache-ControlHi 

Hi there.

I don't know if you did or did not find the answer to your search (I'm pretty sure you did), but maybe this will help other persons.

The idea is that by default the Response had set the "no-store" attribute, and because of this imediatly after open and download the document is deleted from Temporary Internet Files.

So what you have to do is response.ClearHeaders() before setting your own attributes.

For more information ckeck how the DNN team did it: Library\Components\FileSystem\FileSystemUtils.vb

Keywords: can't open downloaded files

 

Happy coding

 
New Post 8/26/2007 1:17 PM
User is offline Zymm
3 posts
10th Ranked


Re: Cache-Control 

Cache control is a complicated subject and like a lot of other stuff, the default IIS options don't provide an extensive/consolidated place to control all the possible options from.

Try CacheRight from Port80 at http://www.port80software.com/products/cacheright/

Theres a 30 day trial so there's nothing to lose by trying..
We've got basically all the other Port80 products installed on our server and swear by them.  Last week I realized our Cache stuff wasnt being taken care of so I bought Cacheright too, and voila, I have an organized scheme for cache control, at a granular level..  the current rule set we use is

ExpiresByType text/htm : 7 days after access public no-transform
ExpiresByType text/html : 7 days after access public no-transform
ExpiresByType image/jpeg : 6 months after access public no-transform
ExpiresByType image/jpg : 6 months after access public no-transform
ExpiresByType image/gif : 6 months after access public no-transform
ExpiresByType image/png : 6 months after access public no-transform
ExpiresByType text/css  : 6 months after access public no-transform
ExpiresByType text/js  : 14 days after access public no-transform
ExpiresByType application/x-javascript  : 14 days after access public no-transform

 

 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Cache-Control
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


ASP.NET Web Hosting for $3.95
3 Month FREE ASP.NET Hosting! FREE Setup! DNN Support! FREE Domain Name! FREE Components! Host multiple websites on 1 plan! 30 Days Money Back Guarantee!
www.dailyrazor.com
Cestus Websites
DotNetNuke websites en services in Nederland. Cestus Websites levert websites, projectmanagent, skins, modules, training en gespecialiseerde hosting op basis van het CMS DotNetNuke.
www.dotnetnuke-websites.nl
FREE Skins, Modules & Control Panel!
Choose how much you want to pay on our Skins, Modules, Containers and Control Panel - Starting from FREE!
www.dnngroup.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP