|
| Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more. |
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
I was looking into speeding up my site.. specifically by using headers to specify custom cacheing..
Previously I was using php to send the necessary headers, but now I just have this in my /htdocs/.htaccess file. Code:
Please note that the "A" before the numbers above stands for Access. This means that the stopwatch starts when a client accesses the file. You can also use "M" for modified.. Then from a Linux/BSD/Macintosh shell, wget to the file you want to see the headers for. When I use wget to do this, I specify the following flags: -S // prints out the headers returned from the server -p // also downloads anything required to view the page (like css, and images) --spider //specifies to wget to not download anything, just to crawl But don't take my word for it.. the proof is in the pudding.. below. This is the results when not using Expires Code:
This is the results when using Expires Code:
From these examples you should be able to see what is going on that is so dramatic. Basically, what this Expires does for you is it allows you to command the clients (site visitors) web browser to save a local (on their own computer) copy of everything you say to cache. The way I have my htaccess setup (above) all the images on the site will be saved for 30 days on the users computer. To REALLY speed up your site, add a line to the Expires in htaccess for text/html that expires every hour or two. The only reason that I do not do this, is that I have php displaying the current date and time, and I am using some random images in a creative way, so I cannot do this. |
|
|
|
|
#2 |
|
Join Date: Jan 2005
Location: Northeast
Posts: 185
Reputation: 52
|
If there are any HTTP cache-control header experts out there, please confirm or deny this, but...
As I understand it, the "expires" header tell the browser cache (or proxy server) to keep a page for at most a certain time, not at least a certain time. If you want the browser to cache a page or image as long as possible, you don't have to send out any special headers. You should only send an "expires" header if you want to force a browser to get a fresh copy of a frequently updated page, instead of the cached copy. |
|
|
|
|
#4 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
Did you look at the wget capture?
It sure doesn't look like there are default expire headers sent by apache.. in fact their are not. Do you mean default as in ExpiresDefault? This is a command to specify all filetypes instead of specifying the correct ones. Adding the Expires header is better than no expires header. It forces some browsers to cache a local copy, whereas no expires header isn't bad just slower... and dependent on client browser setttings. |
|
|
|
|
#5 | |
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
Quote:
IE, for example, caches the data (depending on the setting) without Expire header. How it supposed to work. http://www.w3.org/Protocols/rfc2616/...3.html#sec13.4 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html Also, you may need to test many times to evaluate the effect more accurately. Take a look at the access_log, too. |
|
|
|
|
|
#6 | ||
|
Join Date: Jan 2005
Location: Northeast
Posts: 185
Reputation: 52
|
As keyplyr mentioned, sending your own headers just overrides the default behavior, which is usually to cache whatever is likely to be needed again. The rational for the default cache behavior is mentioned in section 13.2.2 in the HTTP documenation at www.w3.org
Quote:
There are certain types of requests, such as authenticated pages, that are not cached by default. You can use the cache-control headers to override the default behavior and request that they be cached. In the headers you captured (without Expires), you can see the entries: Quote:
I only use Expires headers to force short expiration times for frequently updated pages, but my browser cache is full of images and documents from my sites that don't send any Expires headers. I think that if you remove the Expires stuff from your .htaccess file, you'll find that your browser will still cache files from your site. |
||
|
|
|
|
#7 | |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
Quote:
Yes but with Expires you can have such a higher level of control than without. Without, you can't be sure if your image is cached or not... there is a lot going on. When you specify Expires.. everyone (including search engines) like this more. Code:
There is a reason Powweb has it on the apache servers.. I think you'll find that if you actually do some testing with this, you will see the benefits.. if not, please don't quote the Apache documentation... ![]() Let me know if you guys have any other tips specific to using htaccess. A good tip is how this method lets the client cache even the favicon for a set period. PDF WITHOUT HTACCESS Code:
CSS WITHOUT HTACCESS Code:
JPEG WITHOUT HTACCESS Code:
JAVASCRIPT WITHOUT HTACCESS Code:
PNG WITHOUT HTACCESS Code:
|
|
|
|
|
|
#8 |
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
Produke, I appreciate your effort.
But you should provide more data to backup your claim. Also, testing with the wget isn't representative, in this case. To see if the effect of caching, you shold check the access_log (or Header capturing utility) to confirm all requests coming from the browser and how the server responded. With cached data, the browser doesn't make any request, normally. Even with reload, the browser send a request with if-modified-since, and the server tells back it can use the cached data with 304 response. I took time to test your code, and the result shows there is no difference what so ever in the way the browser and server reacted that influences the performance. How I tested: I used FireFox with LiveHTTPHeader. I created "expire" directory where i put a .htaccess file with the code you suggested. Then I put simple html file, aaa.html in the directory, as well as in the /htdocs. I cleared browser cache, and requested aaa.html, and reloaded the page. I cleared the browser cache and repeated the test. In both cases, FF request with "if-modified-since" indicating that it cached the data, and the server responded with usual 304 response code. http://pow.check-these.info/expire.html So, with or without the Expire header, FF cached the data and used it, even on the relaod. Now, I want you to do similar test showing the case where Expire header really make the differences. You can use following URLs for testing/comparison. Without Expire code: http://pow.check-these.info/aaa.html http://pow.check-these.info/aaa2.html With Expire code: http://pow.check-these.info/expire/aaa.html http://pow.check-these.info/expire/aaa2.html |
|
|
|
|
#9 | ||
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
Quote:
Quote:
I hope these quotes help explain how using mod_expires dramatically helps speed up your site. Code:
Extras.. wget is more reliable and accurate than livehttp headers on any day of the week.. I guess a cgi or tcpdump would be more verbose.. I'm curious why you advise against using wget? |
||
|
|
|
|
#10 |
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
Produke, use tcpdump if you want, but see the fact that FF (and IE) use the cache without Expire header.
And they use cahce even with reload (in this case, the browser checks the freshness, though). In other words, to prove the merit of added Expire header, you should run at least 4 tests. #1 Without Expire header, 1st run after clearing the browser cache. #2 Without Expire header, 2nd run. #3 With Expire header, 1st run after clearing the browser cache. #4 With Expire header, 2nd run. And if #2 and #4 show different results, then you can say it improves. If not, it has no effect. I did exactly that, and I didn't see any differences. Both #2 and #4 used cached data, didn't make any request for the image. So, adding Expire header had no impact, in that test. It's time for you to do the same and show the result. As for wget vs browser, you need to understand we are concerned about how browsers act. Wget is a good tools for testing certain things, but not for this one, as it may act differently. And to see how browsers act, you need to use a tool like LiveHTTPHeader or to look at access_log. (Tcpdump, EtherReal can be used, too. But access_log is far easier to check. ) |
|
|
|
|
#11 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
extras- I appreciate you motivating me to prove what I know, as that helps others, which is the point. So thanks. And although I would love to use ethereal or tcpdump to give you uncompromising data, I just don't have the time at the moment (in the middle of web site launches). Instead, I wrote a simple php script that consists of a form with a single input box to enter any web address. The script then calls a bash shell script with the value from the input box to issue the following commands which retrieve the headers returned for the requested web address.
Code:
I learned how to write these scripts thanks to an incredible resource of tools/scripts/source code at http://check-these.info/ With that said, I am now 100% clear and convinced that the method I outlined in my first post will dramatically speed up your site to visitors! Unfortunately, because the powweb forum people DISABLED img posting, I cannot include the image that details exactly how this method works so well. I had to post it on my development site, http://www.produke.com You will notice from these images, how expires works. With expires OFF, your browser does cache the images, but what you fail to realize is that because your browser has no expires info on your images, your browser must re-check that an image in its cache has not been modified.. it does this for every file, every time you access the page! SLOWWWW! With expires ON, your browser caches the images, but in your cache, it knows that it doesn't have to check for a new version until the expires information tells it that it has expired. FASSSSTTT! Its pretty simple, and I personally have seen a dramatic increase in my sites performance, and so have my clients. Heres the latest relevant htaccess I am using Code:
|
|
|
|
|
#12 | |
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
Quote:
I've tested with FireFox and IE (5), and both of them used cache without making any request for the server, regardless of the Expires header. See it by yourself. I made test case for you. Go to this directory and click and aaa.html, and then aaa2.html, and finally showlog.cgi http://pow.check-these.info/expire/ Repeat the same for another directory without the Expires header. http://pow.check-these.info/noexpire/ You can also see the .htaccess in each directory. The showlog.cgi will show you that aaa.gif isn't accessed with the request for aaa2.html. In other words, browsers use the cacheed aaa.gif without checking the freshness. But I'm not saying that it will never make any differences. If you find a case I can confirm, let me know. So far, the test method presented by you weren't enough, IMO. |
|
|
|
|
|
#13 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
extras-
It is not a short-term gain in bandwidth.. This method is a long-term way to guarantee speedier rendering for your visitors. I would suggest that you read up on Caches in general and about the expires header to better understand the result of this method. IOW, I don't have the expertise to really explain the inner-workings of this apache module.. GRTFM but not apaches online docs.. I would recommend you look at the source code for the mod_expires and google it.Another side benefit that I failed to mention is that any proxies that are operating between you and your visitor will see and USE the expires header. You could also assume that search engines use this information. The special part of this is that the headers are sent by the server.. not by a meta tag in the html file. This is key to getting search engine robots and other hard/soft-ware to really use this header. It is ONLY meant to speed up sites that have repeat-visitors. I am using this method on a site that has a lot of members, who access the page at varying frequencies. It enables your visitors to shorten their packets by not asking when the last modification time is, it also instructs their cache for how long to keep the images before the browser sends a GET request for the object with an If-Modified-Since header. Then the server (your webpage) will have to respond with a 304.. all useless if you use expires. I might get back to you on this with some raw packets, but I just can't right now. The testing involved in proving what this was designed and implemented by apache to do would be a lengthy excercise in packet capturing and study. |
|
|
|
|
#14 |
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
Produke, you are not giving any hard evidence.
Read what I wrote, again, and do the test to see by yourself, please. So far, you are not showing anything that can be retested/confirmed by us, unlike I've done for you. And my tests show that your clain isn't true, at all. If you have time to post some text without any supportind data, please do the test I showed. It only takes a few minutes. ![]() |
|
|
|
|
#15 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
the test you recommended would not be worthwhile to do, that test would not provide enough evidence.
Only a packet level program and subsequent ananlysis would be good enough evidence. But I say, why do what apache programmers have already done? |
|
|
|
|
#16 | ||
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
Quote:
The access_log shows all requests browsers make (unless logging server is having trouble). So, we can say that regardless of the Expires header, cache is utilized and browsers (at least IE5 and FF) are not making any request for the cached image with the test. Very simple and easy to understand. Quote:
I was hoping that you can come up with solid data and test condition that prove your theory and we can retest/confirm. Too bad. |
||
|
|
|
|
#17 | |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
No, you are right, but I just don't have the time right now to test, I stated earlier that I might do a thorough test when I have the time (freetime).
I did some initial testing to see if the test was doable in a short time or not, and for this I just used ethereal, IE, and firefox, and their respective temporary file folders. I also used an OpenBSD box with Squid running to view the effects expires has on an intermediary proxy. This is no small test, don't pretend it is. I think the confusion is occuring because I didn't make clear that this is a client-side improvement in speed. Ultimately, if you use expires, your visitors will see your webpage rendered faster because their browsers will be able to determine when to fetch from the cache and when to send an If-Modified-Since header, and when to fetch from the server, and when to clear an item from its cache. Quote:
|
|
|
|
|
|
#18 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
Ok extras, I did a brief test to stop the debate. I think this really clears up what exactly expires does, and shows how using it can dramatically speed up the rendering of your webpages to visitors. There shouldn't be anymore doubts, but hey, I'm here for ya!
KEY: Clean Start == I browsed to google and deleted all files/cookies/and history and setup my test page as the default homepage. Then I closed the browser, turned on ethereal, and opened the browser. Refreshed == After the clean start, I restarted ethereal, and then refreshed the current test page. Closed and Reopened == Without clearing the cache, I closed the browser, started ethereal, then reopened the browser. Expires Off Clean Start Code:
Clean Start Code:
Refreshed Code:
Refreshed Code:
Closed and Reopened Code:
Closed and Reopened Code:
|
|
|
|
|
#19 | |
|
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 7,130
Reputation: 333
|
Quote:
using php was probably the thing slowing your site down. Any files that don't need php should never use php on a shared server.
__________________
I don't suffer from laziness, I enjoy every minute! Edit your php.ini here http://members.powweb.com/member/cgi...nt/PHPplus.bml |
|
|
|
|
|
#20 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
Yeah I hate that...I do love that php is server-side, I don't want to require javascript ever from site visitors.. So any speedier cgi or shell script solutions are really what I'm looking for.
Expires doesn't work well with dynamic pages like htm pages that are parsed for php.. Thats why I am using headers in my php. I need php to display the current date and random pictures, and for other stuff. I don't want to get off-topic, but please let me know if I can do anything better/faster. Heres the php I am currently using on htm files - [ index.htm ] Code:
Heres the htaccess I am currently using - [ .htaccess ] Code:
I also use a combination of javascript and CSS to preload my main images HEAD - [ index.htm ] Code:
JAVASCRIPT - [ y.js ] Code:
BODY - [ index.htm ] Code:
I dont use any IMG tags, instead I use CSS to apply a background image to an A tag - [ index.htm ] Code:
CSS - [ y.css ] Code:
But for my javascript to work I need - [ index.htm ] Code:
And then I use this CSS - [ y.css ] Code:
If you see anywhere I can improve please tell me! With all of this in place, my site is sooo much faster than before.. which is important because powweb is so darn slow! |
|
|
|
|
#21 |
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
Good. You finally did the test.
![]() Looking at your test result, it's clear for me that you didn't needed TCPdump or Etherrreal. Checking raw log or using utilities like LiveHTTPHeaders (or the equivalent for IE) is enough. Both can show all requests made by the browser and the response code for it. Also, as I said, there is no difference in the reaction of browsers for the initial request and the refresh. Although you didn't check, there is no difference for the request for the page that uses same resources, either. But you are showing new data (at last ....) that it affects the reaction of browser (IE?) after closing and reopenning. So, that might be the "condition" Expires header makes difference. I'll test that, later. I've been wondering the default behavior of IE & FF about the cache. I know that IE had (still have?) the option to check the freshness on a) each request, b) each start up or c) Never, or something like that. I tried to find that option in IE5 the other day, but I couldn't. Maybe it's not there anymore, and the default is set to c) Never.(The default behavior in the past was b) on each startup). If so, Expires will have impact on someone who visits the site repeatedly, and if s/he closes the browser in between. I searched MSDN and some other places about the default behavior of IE about the cache, but I didn't find anything, so far. In old FF I use, there is no option (but maybe I can set using config file...) In short, for visitors like me (my machine is on 24/7, with FF always opened ), it wouldn't make any difference, unfortunately. For someone who turns off machine each night, or someone using unstable OS that needs to be rebooted often, it may have impact on repeated visits. However, you should be aware of the side effect of using it. When you want to modify some items, you have no mean to change them unless you use different names and change all links and references for them (unless you are willing to wait for the expiration time). It can be a burden for some site, in some cases. Last edited by extras : 3-8-06 at 12:23 PM. |
|
|
|
|
#22 | |
|
Join Date: Jan 2005
Location: Northeast
Posts: 185
Reputation: 52
|
Quote:
The options for "Check for newer version of stored pages" are:
|
|
|
|
|
|
#23 |
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
Thank you.
![]() As I don't use IE very often anymore, I was lost in it. I guess the default is "Automatically", too. So, I'll find out what it does, after closing and reopening. |
|
|
|
|
#24 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
Hey extras- I just wanted to warn you about relying on server logs or especially relying on livehttp
LiveHTTP is a cool extension, no doubt, but you seem to be unaware that it regularly misses requests. It definately should not be relied upon for serious testing. The ONLY way to be sure about the packets is to use a program like ethereal. When I use ethereal for this type of work (or tethereal), I use the builtin filter to specify that it should only capture (or display) packets that use the HTTP protocol, the filter is quite simply "http" And as for relying on the server logs, ops is sooo slow! And even apache is known to miss some requests. A huge benefit of using a packet-level capture program is that you can also see info such as content-length, content-type, acknowledgement and sequence info, etc.. I used to be a computer security consultant, thats how I know about this random stuff. |
|
|
|
|
#25 |
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
I know the situation of the raw log, here.
(You will see some posts of mine treating the subject if you search.) It wasn't very reliable in the past, especially after the clustering setup was introduced. But it's more reliable now, and if it misses, it doesn't miss always the same type of request. So, you will definitely know if something is wrong with logging by repeating the tests. So far, during the test I've done, i didn't see any missing entry. As for LiveHTTPHeader, I never noticed the case. As I often cross check with log or other means, I don't agree with your statemewnt "it regularly misses requests.", again, presented without any supporting evidence. But I take a note, and I'll recheck things if necessary. ![]() I don't deny the virtue of TCPdump or Ethereal or any other utilities. I use them when I need. In this case, there was no real need, as the raw log supplies all info needed. And I just finished the test on Win/Linux using IE/FF/Konqueror. Wait for the next post. ![]() Last edited by extras : 3-9-06 at 07:06 PM. |
|
|
|
|
#26 |
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
Testing method:
I accessed following URLs, and then closed the browser and revisited them, again. I tested with FireFox and konquror. With Expiration header on gif http://pow.check-these.info/expire/aaa.html http://pow.check-these.info/expire/aaa2.html http://pow.check-these.info/expire/showlog.cgi Without Expiration header http://pow.check-these.info/noexpire/aaa.html http://pow.check-these.info/noexpire/aaa2.html http://pow.check-these.info/noexpire/showlog.cgi FireFox/Linux old version:
Konqueror/Linux IE5.5 Windows
FireFox Windows
Conclusion: For FireFox (both Linux and Win2K) and Konqueror/Linux, there was no effect of Expiration headers. However, it was interesting to see, FF used cachce without checking freshness for html and gif, while Konqueror didn't use cache for html but used cached data without checking freshness for gif, after closing anf reopening the browser. On IE5.5, when the cache checking is set to "Automaic", the Expiration headers DOES make difference by skipping the request. And it will reduce the load time IF there are many items in the page. (When there are only small number of items, with the 304 response, I don't think it changes a lot) My recommendation: As majority of people are still using MSIE with default configuration, the use of Expiration headers may reduce the bandwidth and hit, and improve the page loading time for the visitors, if they turn off the machine (or browser). For users of FireFox, for people who keep their machine (and browser) open 24/7, there is no benefit, as far as I could see. Personally, I wouldn't bother, as both the bandwidth and the requests are not my concern, and frequent visitors of my main site use FireFox, which uses cached data without Expiration header. Note: These tests are limited to .html and .gif. Some other file types may benefit from Expires much more. If you find something interesting, please report. ![]() |
|
|
|
|
#27 | |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
extras- your information is completely useless without the full (at least relevant) htaccess file used.
I went ahead and did the same procedure I did before using FF on windows, and found you are correct. The FF cache may or may not use the Expires header, but even without the expires header it does not send 304's upon reopening of the browser. And why in the world would you keep FF on linux open 24/7? I think you might be the only one that does that. For one thing, FF isn't made with AJAX, you actually have to close and reopen to update the program. And for another thing, windows crashes or has to reboot ALL THE TIME due to software upgrades and bad programming, and FF is more resource intensive on windows than a linux/BSD environment. Also, I'm curious why you would prefer to use Konquerer.. I find it to be slow due to its multi-purpose code of filemanager/browser If you are using linux I would strongly suggest using Opera instead.. It is very nice! And my fav linux is archlinux, though I am also running slackware and gentoo. ------------------------------- I repeated this same test using a Squid Proxy in between my browser and the target site. I tried the tests using the proxy in full mode (meaning I had to configure the proxy in my browser) and also in transparent mode (where all browsers use the proxy without knowing it. I found that the Squid proxy uses the Expires Header as its #1 indicator of a cached files freshness! This is big news for anyone now using mod_expires... Quote:
Expires is definately used in Squid and this should explain why using Expires header will drastically improve the speed of your site to visitors who are behind a proxy (think libraries, schools, corporate buildings, peoplePC dialup users, etc. etc..) |
|
|
|
|
|
#28 | |||||||
|
on hiatus
Join Date: Mar 2004
Location: Canada
Posts: 5,815
Reputation: 314
|
Quote:
http://pow.check-these.info/expire/ http://pow.check-these.info/noexpire/ I made the .htaccess visible for you. http://pow.check-these.info/expire/.htaccess http://pow.check-these.info/noexpire/.htaccess Do you understand that I made the setup totally transparant for you from the beginning? And I've already told you that you can see the .htaccess. ![]() So, my info is totally relevant, well prepared, extremenly user friendly and thorough. Quote:
Quote:
![]() Quote:
Quote:
Maybe because I don't allow spywares like Winfows auto update to run. Quote:
And I only open it when i need it, for exmaple, to cross check something. Quote:
------------------------------- I'll read about the Squid test. Thank you for the info. ![]() I think, there is a very simple way to achieve the same (or pretty similar) effect as the Expires header in IE. Any user who would like to speed up the load time should simply choose the "Never" option, I guess. I think that will make IE acts just like FF for the cache, and pretty easy to do. As for the effectiveness of the Expires header, I'm a bit curious about dynamic pages |
|||||||
|
|
|
|
#29 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
The expires header does not work on dynamic pages.
Of course you can set it up to work on dynamic pages but you must first convert the dynamic into the static. I would guess by adding a handler that is a cgi program that converts it? I honestly don't know. For me its just not viable, as all my html files contain dynamic content. As I showed earlier, I use php to output headers on all my .htm (handler php) files because I don't want them cached by a browser. Since I use strict XHTML+CSS and I don't include any inline JS, or CSS, the .htm file is extremely small, and yet the CSS, JS, and all other page items get cached! My htm pages for instance, fit on just 4 packets! Without compression! |
|
|
|
|
#30 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
Reset client cache with ETag
So I ran into a problem after I had been using the Expires tips outlined here..
Basically the problem was that there was no way to 'reset' a clients cache for something like a swf, pdf, etc.. the clients stick to the Expires rules you outlined for them. So, one way that I am testing now to reset clients caches is to use the FileETag directive Powwebs default setup uses FileETag INode. So when I change that to something like FileETag Size, the headers for the various files get a new Etag which causes the cache to be reset. You can try it out by adding Code:
|
|
|
|
|
#31 |
|
Join Date: Jul 2005
Location: USA
Posts: 119
Reputation: 41
|
Ok so the etag thing might not work to force the client to recache.
I've tried Code:
So I ended up doing the following- from HTML Code:
to HTML Code:
And then when I make a change to the files, I just ++ the v= to v=1a or v=2 When I am actively developing a live site, I change the expires code to Code:
This enables my browser to To check the last-modified (or etag) of the javascript and css files 1 second after I last viewed it. This means I don't have to hit the refresh button! But more importantly, it means my clients don't. |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|