Long Static Page Caching

I support several client sites that do not have any dynamic data, all statically asp.net from C #.
Are there any pitfalls for caching the entire page for extreme periods of time, for example, after a week?

Kibbee We use a couple of controls on sites (ad rotator, some ajax extensions) on sites. They may have been written entirely in html, but for convenience, I was just stuck in what we use for every other site.

+3
source share
6 answers

The only significant error with long caching times occurs when you want to update this data. To be safe, you must assume that the new version will take up to a week. Intermediate hosts, such as ISP level proxies, often cache aggressively, so this delay will occur.

If there are large files for caching, I would look at the fact that your content engine supports If-Modified-Since.

For smaller files (page content, CSS, images, etc.), where reducing the number of rounds is the key having a long expiration time (year?) And changing the URL when the content changes are better, This allows you to control when user agents will retrieve new content.

Yahoo! HTTP- . , , , .

- , , , , , . If-Modified-Since, Last-Modified .

, , , URL-. URL- URL- HTTP 302, .

+2

, . , , ..

, , - , . , , .

, - /, , , ( , script ..).

, -, IO ( ).

, , , :)

+1

, ? IIS .

+1

, , asp.net #. HTML? , , , , , . , .

0

You might want to create a cache update mechanism if you want to do this, just to make sure you can clear the cache if you need to update the code. Other than this, there are no problems that I can think of.

0
source

If this is static, you will probably be better off generating the pages once, and then directly transfer the resulting static HTML file.

0
source

Source: https://habr.com/ru/post/1696607/


All Articles