|
| |
|
|
John Morch
Posts: 93 From: NZ Status: offline
|
External CSS and Cache - 7/24/2005 21:07:35
Maybe a dumb question but here goes. When developing you need to correct external CSS files a few times. The old ones get stuck in the cache (in my case a ISA 2004 one on our broadband connection) How to you force the external style sheet to be refreshed? John
|
|
|
|
John Morch
Posts: 93 From: NZ Status: offline
|
RE: External CSS and Cache - 7/25/2005 4:05:29
Let me re-phrase the question In an html page you can set cache control, timeouts etc. How can you do the same in the css file that is also stored in the caches (especially the one in a ISA 2004 server that many large companies use to minimise bandwidth). John
|
|
|
|
jaybee
Posts: 13784 Joined: 10/7/2003 From: Berkshire, UK Status: offline
|
RE: External CSS and Cache - 7/25/2005 4:52:05
OK, found the following and it's pretty much what I end up doing. I don't think there's any other way. quote:
Browser caching Sometimes a browser will cache your Thoth documents. Refreshing a page does not refresh any cached pages. Often, XML documents or CSS documents are cached to make sites run faster. Unfortunately, if you change a Thoth document or a stylesheet, then the changes will not show up since the browser doesn't refresh such cached pages. I have often found myself making changes to my Thoth code or my stylesheets, then I test the application in Safari, and it doesn't seem to be changing at all. Naturally I assume my code is wrong so I spend unnecessary time trying to figure out what is wrong. In the end I realize it's just that the page has been cached by the browser. Holding down Shift and clicking the refresh button sometimes refreshes all cached pages in most browsers, but sometimes it doesn't refresh XML and CSS documents. To refresh these pages, you need to open those pages in your browser and only then hold down Shift and click the refresh button. For example, if absconditus.com/index.html uses a Thoth document named main.xml, and I need to refresh main.xml, I need to open absconditus.com/main.xml in the browser, refresh it, and then open index.html again. That usually does the trick. Sometimes you can also set the browser's Preferences to refresh all pages every time you visit a page, and this usually takes care of the problem. If you have control over your META tags, you can use them to refresh the page each time a user visits. In any case, refreshing these pages is becoming a standard part of my debugging/development process when things aren't working right, and caching is often the culprit. If you're working with XML and/or CSS, always check for caching problems, even if you're not working with Thoth.
_____________________________
If it ain't broke..... fix it until it is. GAWDS Now where did I put that Doctype?
|
|
|
|
John Morch
Posts: 93 From: NZ Status: offline
|
RE: External CSS and Cache - 7/25/2005 4:58:11
Thats what I always do as well. I was just hoping that there was a way force CSS and includes some way. Often you are talking to a client on the phone and updating the site at the same time. When the cacheing upstream gets in the way the ctrl refresh does not work on those files. With using frontpage I often will rename the css file and of course republish the whole site. OK for new sites under development but not live ones!!! Maybe someone will let us know a way to force refresh these file types as they are becoming more used!!
|
|
|
|
dpf
Posts: 7121 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: External CSS and Cache - 7/25/2005 10:06:10
that technique allows the developer to refresh but how do you teach it to every visitor? i get that a lot where user/clients cant see my changes
_____________________________
Dan
|
|
|
|
thig95
Posts: 1 Joined: 8/9/2005 Status: offline
|
RE: External CSS and Cache - 8/9/2005 11:03:21
Hey, so i just came across this forum and i'm having a similar problem. I'm currently developing a web application which is written primarily in PHP and also uses CSS files. I'll be making my changes to the main .css file and the index.php file without problems and then all of a sudden my browser will just stop refreshing the new changes. What is interesting to me is that it is not a problem specifically with my browser, as I tried to load the page on a laptop which hasn't viewed the page for days and what loads is what i'm seeing on my dev computer. So i'm guessing issues like this must be server related, but i'm just an admin and def no expert. Maybe we can try and find out if Windows 2003 server has some mechanism that is preventing the changes to be applied right away if a file has been altered more then a set number in a given time period. That would make sense to me because i usually run into this problem an hour or so into development. Any thoughts?? ~Brian Polk Senior Technical Support Delta Financial Associates brianpolk@deltafin.com
|
|
|
|
danrendrag
Posts: 24 Joined: 6/2/2004 From: Atlanta, Georgia USA Status: offline
|
RE: External CSS and Cache - 10/25/2005 23:43:09
I too have had the same issue many times - drove me nuts! Here's my solution: To get around the problem of caching the css file while developing, I copy the existing css to a new file (ex: dev-css.htm), add opening & closing style tags and then call the file with an include in the document head. (also disable the external style sheet reference) The end result being embeded styles - If the page refreshes, so does all the underlying markup. When finished, I merge the changes back into the original css file and reconfig the page(s) to use <link rel... Actually, you could simply use this technique instead of <link rel... and never look back - haven't done that myself though. Dan Gardner
|
|
|
|
Tailslide
Posts: 5771 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: External CSS and Cache - 10/26/2005 2:58:13
My solution was similar to your Dan - I have a normal link to a stylesheet called whatever.css (the normal link deals with fouc problems) and in whatever.css I have nothing but a @ link or links to the actual stylesheets (thus filtering out all the ancient browsers that don't like CSS much). When I do major changes in the CSS I just change the name of the CSS file linked by the @ in whatever.css. When a new name is used for the CSS file the browser will always go look for it. In a way it's sort of like using includes - just have to change the stylesheet name and the name in whatever.css.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
Phil Bathe
Posts: 1 Joined: 5/9/2006 Status: offline
|
RE: External CSS and Cache - 5/9/2006 12:54:48
Try adding a ? to the end of the link ie: "includes/style.css?" - it is probably very wrong and upsets the purists but it seems to work on FF and IE - I'm guessing because it has to parse the querystring (even tho its empty) or some such type of technowotsit
|
|
|
|
rdouglass
Posts: 9136 From: Biddeford, ME USA Status: offline
|
RE: External CSS and Cache - 5/9/2006 13:16:06
Personally I usually put all my CSS in a style.asp file as an include while I'm developing. Cures most all caching issues. I can do final tests by changing only 2 lines and renaming the file to style.css.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
feebool
Posts: 1 Joined: 1/24/2008 Status: offline
|
RE: External CSS and Cache - 1/24/2008 5:07:08
http://www.sharepoint-tips.com/2007/11/avoiding-css-caching-issues.html I haven't tried it yet (doing the rename thing), but I will for next time. Annoyingly even if I get the stylesheet to load it is now caching the imagefiles that are used as background: url ## IN the css files, so I have to change those by hand too. Perhaps I could make a development user that does not have caching enabled on the server.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|