CSS File Updates

G

Guadala Harry

Suppose an aspx page is linked to a css file in the typical way:
<LINK href="MyCSSFile.css" type="text/css" rel="stylesheet">

Then the css file gets modified on the server while a user is viewing the
aspx page.

When specifically would the user get the updated version of the css file? I
presume it would be on the next PostBack or on the next request of an aspx
page that links to the modified css file... but I'd like confirmation of
that.

I'm interested in knowing knowing the specific mechanism that controls when
css files get updated on the client. Does the browser check on every trip to
the server?

Thanks!
 
J

Joerg Jooss

Guadala said:
Suppose an aspx page is linked to a css file in the typical way:
<LINK href="MyCSSFile.css" type="text/css" rel="stylesheet">

Then the css file gets modified on the server while a user is viewing
the aspx page.

When specifically would the user get the updated version of the css
file? I presume it would be on the next PostBack or on the next
request of an aspx page that links to the modified css file... but
I'd like confirmation of that.

I'm interested in knowing knowing the specific mechanism that
controls when css files get updated on the client. Does the browser
check on every trip to the server?

This depends several factors like the protocol version (HTTP 1.0 vs. HTTP
1.1), or caching and expiration related headers, and of course your web
server's configuration.

I'm simplifying this a bit, but assume every resource you obtain over HTTP
has an expiration time. As long as this time has not elapsed, the resource
is considered "fresh", and no new version will be obtained from the origin
host. After the expiration time has elapsed, the client issues a
"conditional" GET, asking the host whether a newer version exist or if it
should continue to use the local copy (and update the expiration time).

This approach allows you to adjust two parameters:

-- the cacheability per se (if there's no local copy, the client must obtain
a new copy of the resource for request)

-- the expiration time


Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top