473,573 Members | 3,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1841
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
6128
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 meet the following error : ------ Rebuild All started: Project: OIDCOMMON, Configuration: Debug .NET ------ Preparing resources...
3
3321
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 resources that explains how to optimize code i.e. give some rules on c++ optimization? e.g. using memcpy to copy an array (which i have done). ...
7
6485
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 little problem to resolve. Our old COM cache would cleanup "unreferenced" entities by checking the refcount on the entities in the cache. Whenever the...
0
1003
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 because of caching and even it skips the break point. So,when i removed the web reference ,it accepted the changes. but after i added the web...
0
1731
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 while to be processed. At the moment I have programmatic page caching in the "loader" using paramater caching to send a cached version of every...
4
1193
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 that the .net framework use the resource as assembliles and store them in cache. My custom provider should get the resources and store them in cache...
0
855
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 As Product = LoadProduct(row.Row) It looks like row.Row is not being found in the view We're caching the data - could this be related to the...
2
1723
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 named 'Dictionary1.xaml'. Normally if all this code was just running in Window.xaml.cs I could use this line: cornerThumb.Style =...
3
1739
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 new images into the resource file and deleted all the old images. But whenever the form is displayed in the designer, all of the old images still...
5
5488
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 simply to make sure they arnt duplicated as they take up considerable memory, so I can look up to see if an existing copy exists. however once...
0
7686
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8016
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7773
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8061
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5584
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5289
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3730
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2197
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.