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

  • Home
  • SEARCH
  • 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 9176819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:11:42+00:00 2026-06-17T17:11:42+00:00

I know this question was asked quite a few times and the most common

  • 0

I know this question was asked quite a few times and the most common answers were:

  1. Auto versioning using the .htaaccess file.
  2. Although this is not at all recommended, using a version number as a query parameter
    For example: ‘/scripts/script1?v=1.0.0’. This will cause the browser not to cache the file but does the job.

I am handling some post release issues and since we don’t follow a software project life cycle as such, we update the site as and when the issues are tested and fixed. So, we may have to update the site several times a day sometimes versus no updates for a week.

I am not sure if there is a way I can still take the benefit of caching and at the same time don’t need to have the users to refresh the page/clear cache to see latest changes.

Is there a way I can implement the .htaaccess solution in asp.net if that’s what I need to do?

I really appreciate any help.

  • 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-06-17T17:11:43+00:00Added an answer on June 17, 2026 at 5:11 pm

    Here is the solution I’ve used for css files, but should work fine for JS:
    In the htaccess have a rule:

    RewriteRule ^(.*)_ver_.*(\..*)$ $1$2 [NC,L]
    

    That takes a file name such as “Style_ver_12345.css” and rewrites it to Style.css.

    Then when when you include the file append the LastWriteTime of the actual file (File.GetLastWriteTime(filePath).Ticks.ToString() is how I do it) as the version number. An example file name that I would have is Style_ver_634909902200823172.css

    This will ensure that any change in the file will immediately cause a new version number, while the physical files does not need to have a different name, and the file will be cached by the browser.

    The user would still have to refresh the page, but they wouldn’t have to clear their cache. If you needed to, maybe you could force a refresh by having an ajax call that would compare the version number of the script loaded with the version number on the server. A newer version on the server could then force a refresh.

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

Sidebar

Related Questions

I know that this question has been asked quite a few times, but I
I know this very similar question has been asked before quite a few times
I know this question has been asked quite a few times, however, I have
I know this question has been asked several times, but I can't quite seem
I know this question was asked here many times before but I am still
I know this question was asked for many times, and it may look like
I know this question has been asked a couple of times before. I m
I know this question has been asked before however the answers I found where
I know this question as been asked countless times, but believe me I've searched
I know this question had been asked a hundred times, but I have difficulties

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.