473,320 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Reference to resources and caching

The following article http://www.mnot.net/cache_docs/#TIPS recommends to
use the same URL to point to an object each time this object is referred
to across a site in order for it to be efficiently cached. Well, this
makes a lot of sense so I'd like to apply this rule.
I can only think of one way to achieve this: using absolute URLs. The
drawback is that I would then have to modify all my URLs before
uploading so I decided to resort to the BASE element in HTML, so that I
have:

<base href="file:///d:/local path/">

and when I want to link to, say, an image, I use a relative URL:
<img src="share/images/pict.jpg">

Then, before uploading my site, I change HREF in the BASE:
<base href="http://URL of the site/">

and everything is fine.

I would like to have your opinion:
- do you agree about my conclusion of using absolute URLs ?
- do you know anything better than <BASE HREF=...> ?
- do you know a way to quickly modify this BASE element (switching back
and forth between local and remote URLs is tedious...)

Vincent.
--
to email me, add "poinot" before the at-sign in my
address and wanadoo after it...
Jul 20 '05 #1
9 1835
On Fri, 26 Sep 2003, it was written:
The following article http://www.mnot.net/cache_docs/#TIPS recommends to
use the same URL to point to an object each time this object is referred
to across a site in order for it to be efficiently cached. Well, this
makes a lot of sense so I'd like to apply this rule.
I can only think of one way to achieve this: using absolute URLs.


You've misunderstood the advice. Relative URLs will be resolved
before testing whether they are cached. What he's advising is to make
sure that - when the URLs have been resolved to their absolute form -
they will be the same.

So there is no benefit (and quite a lot of disadvantages) in going to
the various measures you described. Sorry.
Jul 20 '05 #2
Alan J. Flavell wrote:
On Fri, 26 Sep 2003, it was written: You've misunderstood the advice. Relative URLs will be resolved
before testing whether they are cached. What he's advising is to make
sure that - when the URLs have been resolved to their absolute form -
they will be the same.
That's good news to me because relative URLs bring much more flexibility
to the site maintenance. However, I wonder then how it would be possible
to refer to a unique object via two different absolute URLs, i.e. in
what cases this golden rule the article is talking about could be
broken... I mean, if an object is unique, its location is unique and so
is its URL. I'm somewhat puzzled by this advice.
So there is no benefit (and quite a lot of disadvantages) in going to
the various measures you described. Sorry.


That's fine: I just asked before going through all the big work of
changing everything...

One more time, thanks for your help.

--
to email me, add "poinot" before the at-sign in my
address and wanadoo after it...

Jul 20 '05 #3
On Sat, 27 Sep 2003, it was written:
That's good news to me because relative URLs bring much more flexibility
to the site maintenance. However, I wonder then how it would be possible
to refer to a unique object via two different absolute URLs,


The most common example would be a page that's sometimes referenced as
href="/foo/" and sometimes as href="/foo/index.html". My advice is to
consistently refer to it without the explicit "index.html", then you
are free to change it to index.php or index.cgi or whatever becomes
appropriate, without having to patch up all those bookmarks.

If you want a non-null handle to refer to the default page at the
current hierarchy level, then href="./" is nice.

Worse is where webmasters set their server up to return the same
resource in response to index.htm, index.html, INDEX.HTM, INDEX.HTML
Index.html etc. etc and refer to them by whichever variation amuses
them on the day. And of course *that* isn't confined to index
(default) pages.

URLs are case-sensitive, by definition. The assumption by _some_
misguided windows-based webmasters that because their machine isn't
case sensitive then they don't need to pay any attention to the case
sensitivity of their URLs is completely erroneous.

If you _need_ to cope with dumb authors who can't or won't observe
case sensitivity, then look at Apache's mod_speling: what _it_ does is
not to return duplicate contents, but to issue a redirection to the
corrected URL. It costs an extra (small) network transaction, but
from the cahceability point of view it's surely better.

hope that helps.
Jul 20 '05 #4
Alan J. Flavell wrote:
On Sat, 27 Sep 2003, it was written:

hope that helps.


It sure does. Once again, it seems that my concerns were a bit
far-fetched whereas everything was so simple. Thanks for clarifying all
this.
--
to email me, add "poinot" before the at-sign in my
address and wanadoo after it...

Jul 20 '05 #5
Alan J. Flavell wrote:
[snip]
URLs are case-sensitive, by definition. The assumption by _some_
misguided windows-based webmasters that because their machine isn't
case sensitive then they don't need to pay any attention to the case
sensitivity of their URLs is completely erroneous.

[snip]

Please set my mind at rest (or otherwise):

My understanding is that the part after the domain name, hence the part seen
for intra-site links, is case-sensitive, as you say. But the domain name,
hence the first part of URLs for external links, isn't. True?

Also, I have been working on the assumption that if I use lower case folder &
file names, alpha-numerics and "_", starting with an alpha, I'm safe anywhere.
But are there length restrictions? And am I being too cautious?

Thanks.

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #6
On Sat, 27 Sep 2003, Barry Pearson wrote:
Alan J. Flavell wrote:
[snip]
URLs are case-sensitive, by definition. The assumption by _some_
misguided windows-based webmasters that because their machine isn't
case sensitive then they don't need to pay any attention to the case
sensitivity of their URLs is completely erroneous. [snip]

Please set my mind at rest (or otherwise):

My understanding is that the part after the domain name, hence the part seen
for intra-site links, is case-sensitive, as you say. But the domain name,
hence the first part of URLs for external links, isn't. True?


Yes, that's technically correct (the http: prefix is required to be
lower-case, but domain names are case-insensitive). I'd say it's
still best to be consistent as far as possible, just in case somebody
isn't honouring that detail.
Also, I have been working on the assumption that if I use lower case folder &
file names, alpha-numerics and "_", starting with an alpha, I'm safe anywhere.
Seems fine to me.
But are there length restrictions?


Ultimately, yes, but not that you're likely to find a problem in
practice. The days of URLs getting chopped after 256 or even after 1K
bytes are long gone. Some of today's search-engine queries have URLs
that stretch half way down the corridor... (they can get to be a
problem in plaintext mail, of course, but not in browsers and other
web client software).
Jul 20 '05 #7
Alan J. Flavell wrote:
On Sat, 27 Sep 2003, Barry Pearson wrote:

[snip]
My understanding is that the part after the domain name, hence the
part seen for intra-site links, is case-sensitive, as you say. But
the domain name, hence the first part of URLs for external links,
isn't. True?


Yes, that's technically correct (the http: prefix is required to be
lower-case, but domain names are case-insensitive). I'd say it's
still best to be consistent as far as possible, just in case somebody
isn't honouring that detail.

[snip]

Thanks. My sig may give you a clue about why I asked about domain names!

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #8
On Sat, 27 Sep 2003 13:24:42 +0100, Alan J. Flavell wrote:
On Sat, 27 Sep 2003, Barry Pearson wrote:
Alan J. Flavell wrote:
[snip]
> URLs are case-sensitive, by definition. The assumption by _some_
> misguided windows-based webmasters that because their machine isn't
> case sensitive then they don't need to pay any attention to the case
> sensitivity of their URLs is completely erroneous.

[snip]

Please set my mind at rest (or otherwise):

My understanding is that the part after the domain name, hence the part seen
for intra-site links, is case-sensitive, as you say. But the domain name,
hence the first part of URLs for external links, isn't. True?


Yes, that's technically correct (the http: prefix is required to be
lower-case, but domain names are case-insensitive). I'd say it's
still best to be consistent as far as possible, just in case somebody
isn't honouring that detail.
Also, I have been working on the assumption that if I use lower case folder &
file names, alpha-numerics and "_", starting with an alpha, I'm safe anywhere.


The case-sensitivity of the filename part of the url is host dependant.
IOW, on a Windows-based host (shudder), the filename part is
case-insensitive, but on a *NIX host, it is normal.
Jul 20 '05 #9
On Sat, 27 Sep 2003, Ben Hopkins wrote:
The case-sensitivity of the filename part of the url is host dependant.
That's exactly the mistake that I was warning against.
URLs are case-sensitive by definition.
IOW, on a Windows-based host (shudder), the filename part is
case-insensitive,


No, it isn't. URLs don't have "a filename part", they are opaque
tokens as far as the web is concerned. Only the internals of the
server can determine what they correspond to on the server.

URLs are case-sensitive by definition.

And the misconception that you are exhibiting is one of the reasons
behind Mark Nottingham's warning that we're discussing here.

Blithely asserting that it is otherwise won't change the facts.

Of course, the _file system_ on Windows doesn't make a distinction as
to case, but that's only one part of the whole machinery.
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: WM Chung | last post by:
Hi all, I meet a problem in building my .Net Solution and I would like to seek help. After I have added a dll to reference in one of my project in my solution, when I re-build the solution, I...
3
by: PWalker | last post by:
Hi, I have written code that I would like to optimize. I need to push it to the limit interms of speed as the accuracy of results are proportional to runtime. First off, would anyone know any...
7
by: MP | last post by:
Hello everyone, I am an old C++/COM programmer that converted about 8 months ago to C#/.Net, and I have no regrets. I am now converting our caching subsystem from COM to .Net and I have a...
0
by: pramod | last post by:
In c#.net project I have added a web service(by adding web reference) . Now whatover changes i am making in c#.project in the existing funtion, it is not reflecting and it runs the previous code...
0
by: Troy Simpson | last post by:
Hi, I have a website which is made up of dynamic pages. Each page that's loaded has some code which looks at which template to load amongst other things, which causes the page to take a little...
4
by: YC | last post by:
Hi, We are considering storing our resources in a DB table. My question is whether using a custom provider with the resources stored in DB can downgrade the application performance? I understand...
0
by: Susan | last post by:
..net 2.0 - I've been getting a very strange error on my websites I can't track down. It only happens occasionally, and continues until IIS is reset. The error happens on line 10: Dim product...
2
by: moondaddy | last post by:
I have a WPF windows app and from code in Window.xaml.cs I create an instance of a class whish is derived from Adorner. In this class I create shapes and need to apply a style from a resource file...
3
by: | last post by:
I've got a winForm that has a good number of custom controls with custom graphics that are stored as resources in the project. Recently, I updated all of the graphics with a new look. Added all the...
5
by: colin | last post by:
Hi, I need to cache various resource objects such as images for example, wich might be referenced from multiple objects (wich could be considered documents for ease of discusion) and the idea is...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.