<p>I maintain several client sites that have no dynamic data whatsoever, everything is static asp.net with c#.<br>
Are there any pitfalls to caching the entire page for extreme periods of time, like a week?</p>

<p>Kibbee, We use a couple controls on the sites (ad rotator, some of the ajax extensions) on the sites.  They could probably be completely written in html but for convenience sake I just stuck with what we use for every other site.</p>

[{'answer_id': 36484, 'author': 'Kibbee', 'author_id': 1862, 'author_profile': 'https://Stackoverflow.com/users/1862', 'pm_score': 0, 'selected': False, 'text': "<p>When you say that you have no data, how are you even using asp.net or c#. What functionality does that provide you over plain HTML?  Also, if you do plan on caching, it's probably best to cache to a file, and then when a request is made, stream out the file.  The OS will take care of keeping the file in memory so that you won't have to read it off the disk all the time.</p>\n"}, {'answer_id': 36485, 'author': 'Dana the Sane', 'author_id': 2567, 'author_profile': 'https://Stackoverflow.com/users/2567', 'pm_score': 0, 'selected': False, 'text': "<p>You may want to build in a cache updating mechanism if you want to do this, just to make sure you can clear the cache if you need to do a code update. Other than that, there aren't any problems that I can think of.</p>\n"}, {'answer_id': 36488, 'author': 'Jason Weathered', 'author_id': 3736, 'author_profile': 'https://Stackoverflow.com/users/3736', 'pm_score': 2, 'selected': False, 'text': '<p>The only significant pitfall to long cache times occurs when you want to update that data. To be safe, you have to assume that it will take up to a week for the new version to become available. Intermediate hosts such as a ISP level proxy servers often do cache aggressively so this delay will happen.</p>\n\n<p>If there are large files to be cached, I\'d look at ensuring your content engine supports If-Modified-Since.</p>\n\n<p>For smaller files (page content, CSS, images, etc), where reducing the number of round-trips is the key, having a long expiry time (a year?) and changing the URL when the content changes is the best. This lets you control when user agents will fetch the new content.</p>\n\n<p>Yahoo! have published a two part article on <a href="http://yuiblog.com/blog/2006/11/28/performance-research-part-1/" rel="nofollow noreferrer">reducing HTTP requests</a> and <a href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/" rel="nofollow noreferrer">browser cache usage</a>. I won\'t repeat it all here, but these are good reads which will guide you on what to do.</p>\n\n<p>My feeling is to pick a time period high enough to cover most users single sessions but low enough to not cause too much inconvenience should you wish to update the content. Be sure to support If-Modified-Since if you have a Last-Modified for all your content. </p>\n\n<p>Finally, if your content is cacheable at all and you need to push new content out now, you can always use a new URL. This final cachable content URL can sit behind a fixed <a href="http://en.wikipedia.org/wiki/HTTP_302" rel="nofollow noreferrer">HTTP 302 redirect</a> URL should you wish to publish a permanent link to the latest version.</p>\n'}, {'answer_id': 51377, 'author': 'Rob Cooper', 'author_id': 832, 'author_profile': 'https://Stackoverflow.com/users/832', 'pm_score': 1, 'selected': False, 'text': '<p>We have a similar issue on a project I am working on. There is data that is <em>pretty much</em> static, but is open to change..</p>\n\n<p>What I ended up doing is saving the data to a local file and then monitoring it for changes. The DB server is then never hit unless we remove the file, in which case it will scoot of to the DB and regenerate the data file.</p>\n\n<p>So what we basically have a little bit of disk IO while loading/saving, no traffic to the DB server unless necessary and we are still in control of it (we can either delete manually or script it etc).</p>\n\n<p>I should also add is that you could then tie this up with the actual web server caching model if you wanted to reduce the disk IO (we didnt really need to in our case)..</p>\n\n<p>This could be totally the wrong way to go about it, but it seems to work quite nice for us :)</p>\n'}, {'answer_id': 588126, 'author': 'GameFreak', 'author_id': 26659, 'author_profile': 'https://Stackoverflow.com/users/26659', 'pm_score': 0, 'selected': False, 'text': '<p>If it is static you would probably be better off generating the pages once and then serve up the resulting static HTML file directly.</p>\n'}, {'answer_id': 588171, 'author': 'Scott Hanselman', 'author_id': 6380, 'author_profile': 'https://Stackoverflow.com/users/6380', 'pm_score': 1, 'selected': False, 'text': "<p>If it's static, why bother caching at all? Let IIS worry about it. </p>\n"}]
['https://Stackoverflow.com/questions/36477', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2066/']