CSS - Css File Caching? Is It Automatic?
i have
<meta http-equiv="cache-control" content="no-cache" /> in my head, but i DO want people to cache my .css file because that means less loading time for them. HOWEVER, only if it is not new. is that possible? Similar TutorialsHello, I seem to have a problem whereby IE6 isn't caching images called from my external CSS file/s at http://www.dragonflyoffice.co.uk/. In FF, if you visit the site and go elsewhere or close the browser before returning to the site, the page loads instantly but IE seems to download pages and images each time. I'm afraid this is hampering the expeience for users without high speed connections. Does anyone else know about this? I've trawled the web and found nothing Hi, we've been having a problem since about the start of this year, and i was wondering if someone could help us? When we make changes to our styles sheets they appear to be cached, and the changes dont appear for sometime, clearing the cache of either IE or FF doesnt seem to help, ctrl-f5 doesnt seem to help. A few things that can sometimes help are navigating to the stylesheet itself, press ctrl-f5 then navigating back to the site, but that does not always fix the issue. Also switching between a firefox and ie tab in firefox with the IEtab extension sometimes helps. We are have 3 dedicated servers 1 internal, 2 external, all 3 servers have had the same problem. We have spent several years developing sites on 2 of those servers without problems. No other types of files seem to cache but style sheets are the only files we reguarly change (one of the benefits of moving away from table layouts ). Any help will be greatly appreicated. Does anyone know if when a browser loads a stylesheet, it loads all linked images into the cache - even if they are hidden from view initially? Or do browsers in general wait until the image is required to download it? I'm intrigued because I'm using :hover to do a background image swap. Cheers I am working on a site, http://callagy.netdbs.com It seems when ever I open a page, make a change, it works just fine insofar as the change is made. BUT, if I make a change to the style sheet (style.css), the change is not effective in the site until I save it as something else,then change the ref. to it in a given page. I then need to go back and save the css file back to style.css so I can see the chagne site wide. Tom I'm writing an application that uses stylesheets to display certain items. The user can alter the positioning etc. of these items (which then rewrites the stylesheet for future use), and then reloads the page. Unfortunately the old coordinates are still apllied to the elements in question until I manually hit the browser's reload button, then the new values are used. I'm guessing the style is being cached somewhere? If so can anyone advise how to stop this? thanks p.s. Its just a basic refresh that sorts it out, not a *hard* refresh. ================== I've come up with a fix of sorts. If I write the style out dynamically within the div itself each time then my problem is solved. Can you cache external css files (to make pages that use the same css file load faster)? If so, how? BTW, here is how I currently load my css (from zen garden): Code: <STYLE type=text/css media=all>@import url(/main.css); In what order are CSS/html files loaded? Concurrently? What about browser rendering? Must all CSS be loaded before any html is rendered? Also aside from serverside compression / css whitespace (file) compression, removing redundant classes, and using relative paths, is there any other ways to speed loading of CSS? Would it be of benefit splitting my css file into smaller chunk files - would they all load concurrently and therefore faster? Does anyone have a good solution for forcing the cache of css files, but not the html calling the css? Thanks in advance! Ross Whenever I roll out a new feature (including new layout) to the production version of a website I am working on, I know that it won't properly work until a user downloads a new version of the relevant CSS files. For new users this happens automatically, but existing users have to wait or hit refresh. The result is that the pages look bad for some users when I make changes. I would fix this problem by renaming the CSS files whenever I make changes, but this can get a bit unwieldy since I use SVN for source code management. I would have to make a revision to other source code files solely to reflect a change in the CSS file. Another idea is to control the name of the CSS file from a constant or from my database, but each has its downsides (complexity, performance in the case of the db calls). Is there any easy way to have caching of CSS files, but somehow break through that cache when I make changes? I am guessing not since the cache is based on expiration settings set by Apache, which to be meaningful need to be long. But if you have encountered this issue before, I'd love to hear what you did! How would I go about making the width of a <div> element as big as it needs to be depending on the amount of text. I've got, div.note {width: auto;} but it doesn't seem to be doing anything. (The site in question) Sorry for being so dumb I was wondering if there was a way with CSS, to create a box, where the text within automatically scrolls. For example, I have a box that has a date, and then the latest news. Say that there are about 20 lines worth of text, but the box itself, is only 10, I wanted the text to scroll from bottom to top automatically. I know I could probably do something like this in flash, and I'm guessing javascript as well. But don't want to use javascript. Any help would be appreciated. Thanks. I would like to do automatic resizing textfield depending of resize browser. I know one solution with css style code. for example :<input type="text" style="position:absolute;width:50%">, but it don't accommodate me. Please, exist other solution for this problem? Is there a way to define a text style where a dash and a space is automatically inserted after the text? If I want this: Subtitle and then content To look like this: Subtitle - and then content How can I do that? Thanks HTML <div class="unitWide"> <div class="labelRight" id="appt"> Reaction</div> <div class="widget"><input type="text" name="Name" size="30"/></div> </div> <div class="unitAutoHeight"> <div class="labelRight">Description</div> <div class="widget"> <textarea name="comments"class="wideComment" rows="6" cols="28"></textarea></div> </div> CSS .unitSmall, .unitWide, .unitSmaller, .unitAutoHeight, .unitPair, .unitCal { float: left; z-index:1; width: 100%; height: 2.4em; padding-bottom: 6px; } .unitAutoHeight { height: auto; } input, .wideComment { font-size: 16px; padding: 3px; background: transparent; background-image: url(../images/inputbackground.png); border: none; color: #3f3f3f; font-weight: bold; width: 23.6em; } Hi y'all, Ive got form elements (here called 'units') stacked vertically and left floated to ensure alignment in a fixed-width form. Im trying to get the comment input box to stretch vertically, and add rows as the user inputs longer text. Basically I want to save space on the form by not specifying a predetermined number of rows (which is not the case right now, theres 6 rows), but to let it expand and not hide the overflow or worse, display a sidebar. Ive tried everything, looked in javascript forums, cant find it! Ideally it would behave like the new facebook message or wall post text box. Thanks I was quite proud of that title, especially at 4 minutes past monday. Anyway - I digress. I am trying to create a scrolling news-type box using a div which is clipped so it looks like it scrolls up and down inside a 'window'. I have not declared what height i want the scrolling div to be as i never know how much text will be in it. When you scroll all the way to the bottom, I want there to be a way so that it stops scrolling - and for this i need the height of the div. Is there anyway of finding the height at all, or will i have to use a fixed height div. If my explanation is a touch wooly, the prototype page is here please see following code. (i want myHeight becomes dynamis, that mean when user resize the browser, it will be changed automatic w/o refresh the page). thank you. waitting online for the answer. <html> <head> </head> <body > <table> <tr><td>tasd</td></tr> <tr><td> <script type="text/javascript"> var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } //var height = myHeight *.8; document.writeln("<div style='HEIGHT:" + myHeight *.8 + "; WIDTH:100%; OVERFLOW:auto'>"); //return height; </script> <table> <tr><td> msg </td></tr> </table> </div> <td> msg </td> </table> </body> </html> I'm trying to create a box with rounded corners. This in itself is fine - there are plenty of tutorials around for this. They all either seem to require four divs nested in the corners of the container div. eg: <div id="container"> <div id="topleft"></div> <div id="topright"></div> <div id="bottomleft"></div> <div id="bottomright"></div> blah blah blah </div> Or the alternative works in a similar way, but uses existing tags to "hook" onto, like <h2> or <p>. I want to reuse the round-corner boxes throughout the site. However, I don't want to be required to use my hook tags, and I'd like to avoid specifying each nested corner div each time. I want to say, "This is the Container style. Whenever you see the container style, include these nested corner divs as well." Is there a way to do this? If I include url(images/blah.gif) in a CSS file in my webroot, and i then load that into a file in a html dir off my roor and run the html from the html folder, is the image supposed to be relative to my css file or my html file? It seems like its relative to the HTM which doesnt seem correct. I know It would just make sense to move things around but it has to do with robohelp and I think I'm stuck doing it this way for now. Many of my web pages (CGI) have css styles which have a user defined color present throughout the site. How can i get that varible data back to my site if I refer to it in my css style? for example, i get a hex color from the user and store it in a global variable C1$=#000000 in my web app. then in my css definition i assign border color based on the user defined variable like Code: .table { border: solid 1pt $C1 } when i copy that into my css file, the color thing in my tables is no worky. putting it back into my cgi file, it works fine of course. What to do? thanks, JOhn am creating a website and when I swap between pages the page is shifting to right around 5px, I need to fix it. you can find the files in that link: http://www.designmasr.com/assets/source_files.zip |