---
title: "Explain the use of duration attribute of @OutputCache page directive"  
description: "Explain the use of duration attribute of @OutputCache page directive"  
author: "Anonymous User"  
published: 2011-05-23  
updated: 2020-09-21  
canonical: https://www.mindstick.com/interview/999/explain-the-use-of-duration-attribute-of-outputcache-page-directive  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Explain the use of duration attribute of @OutputCache page directive

The @OutputCache directive’s Duration attribute determines how long the page is cached. \
If the duration attribute is set to 60 seconds, the Web form is cached for 60 seconds; the server loads the response in memory and retains that response for 60 seconds. \
Any requests during that time receive the cached response. \
Once the cache duration has expired, the next request generates a new response and cached for another 60 seconds.

## Answers

### Answer by Anonymous User

The @OutputCache directive’s Duration attribute determines how long the page is cached. \
If the duration attribute is set to 60 seconds, the Web form is cached for 60 seconds; the server loads the response in memory and retains that response for 60 seconds. \
Any requests during that time receive the cached response. \
Once the cache duration has expired, the next request generates a new response and cached for another 60 seconds.


---

Original Source: https://www.mindstick.com/interview/999/explain-the-use-of-duration-attribute-of-outputcache-page-directive

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
