Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 900233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:21:07+00:00 2026-05-15T15:21:07+00:00

We are using IIS7 and dotnet 3.5 in our company to build different web

  • 0

We are using IIS7 and dotnet 3.5 in our company to build different web applications used by our internal as well as external customers. It has been recommended that we start using static content caching to cache image and html files.
My understanding is that in web.config file we can set the cachecontrolmaxage to specify the number of days which the files are required to be cached.
Further it has been recommended that we call these static pages by passing an argument say myjsfile.js?verfile=1234 which can be changed whenever a new version of the file is put in production.

I hope that I go the above right? Now what am looking for is a better way to achieve the second part, instead of having to pass a new version number everytime a new file is created can we have this deployed in some other way so that any new changes to the static file is there in production environment. What I guess am looking for is a simple way to promote multiple images and static files in production without worrying about changing the version number.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:21:08+00:00Added an answer on May 15, 2026 at 3:21 pm

    Since IIS7 all IIS configuration can be applied through the web.config file, more specifically the system.webServer section. In this case you should check at the Caching Section and create a custom profile (make sure to set the varyByQueryString attribute to true to make the “?version=xxx” work).

    Going into the deployment question it’s necessary that the url changes since the client will not check for a new version of the file while the cache is valid (and you say you may want to set days as the cache duration). One common pattern is to autogenerate the url based on the modification date for instance if your original line is:

    <script src='functions.js' />

    You may change it to:

    <script src='<%=GetFilenameWithModificationDate("functions.js")%>' />

    The function should get the File modification DateTime and append it to the file, so if file was last modified con 2010-01-01 at 10:12:34 it should generate something like this:

    <script src='functions.js?version=20100101101234' />

    This way whenever you modify the file a new querystring will be included and cache will be updated.

    Since you are working in caching your static files files I’m assuming that performance is a consideration so you should consider the penalty of checking the modification date for each file and you may want to use caching in the helper function, control or whichever mechanism you decide to use.

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to create seperate workflow instances as applications in IIS7 using the
I am using windows authentication without impersonation on my company's intranet website with IIS7.
We are using IIS7 to host an asp.net web-based application. In this environment administrators
I have a web application which is written in ASP.NET 4. I'm using IIS7
I am using IIS7 Express while developing my web application. I need to use
I'm using IIS7 and ASP.NET. Basically building a simple CMS and need to handle
I am trying to create a virtual directory and set it's permissions using IIS7
I'm using the iis7 URL Rewrite module and it's working fine, except for two
Is it possible to restart IIS7 using C#? If so, how?
I'm using php 5.2 with IIS7.5. I have a network share on a NAS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.