Getting 206 Partial Content and not sure why - apache

I'm getting a 206 on some images, and I'm not quite sure why (thus how to solve it).
Basically all the images are being called through the css file.
background-image: url(Images/i-Background.jpg); //works
background-image: url(Images/i-NavHeader-Blank.png); //doesn't work
However firebug is showing two different sets of request headers for the request, but be damned if I can figure out what could be causing that. I know that the 206 is due to the Range being set, and for some reason on the non-working ones it is set to Range bytes=0-
where as the working ones have no Range header.
Is there any reason why some have different request headers to others?
Thanks,
Psy

Ok, worked it out, was to do with filezilla deciding the pngs needed to be uploaded as ASCII rather than binary, and the server doesn't like ASCII pngs :p

Related

Get a bit of code after image url in browser

I'm changing background image on hover.
The code for image url looks like this:
background-image: url('../assets/img/project1.png');
But when I look in the Chrome inspector it looks like this:
background-image: url(/img/project1.9fba20d0.png);
So when I try to change image need that code (9fba20d0) for it to work.
Why dose '9fba20d0' appear? How do I remove it or get it without hardcoding it?
I actually haven't used Vue.js, but I'm sure the random string appended to end of filename is for "cache busting" purposes.
Basically, the string changes each time you build your application so the next time you request index.html from the server it will reference the new filename (with a different random string at the end). If there was no string, the browser would look locally to find the file, which may be an outdated version, if you've made changes since last rebuild.
I'd try and understand how Vue.js is creating your production "assets", i.e. all the images and other static files and see if you have some options to change the default behavior, if need be. Might have to read the documentation pertaining to caching.
Hope that at least points you in the right direction!

iTextSharp.text.Image.GetInstance changes Request.MapPath

I've been stuck on this problem all night. I've looked everywhere and can't seem to find anything related to my exact problem. On our IIS server we have a page that creates a pdf. We put an image in the header of the created PDF. This had been working properly until last night when we updated some unrelated code on different pages. Now when we try to create the PDF we get an error that the image file doesn't exist. Here's the weird part, iTextSharp.text.Image.GetInstance is changing the path we send to it?
Here's the line of code
Dim oImage As iTextSharp.text.Image = iTextSharp.text.Image.GetInstance(Request.MapPath("~/images/" & sLogo))
If we output the results of Request.MapPath("~/images/" & sLogo) we receive
E:\Inetpub\sitename\images\logo.jpg
When we place it in in the iTextShart.text.Image.GetInstance() function our path output changes to
C:\Windows\SysWOW64\inetsrv\images\defaultlogo.jpg
You can see the logo itself changes too, it should be noted that we do use DefaultLogo.jpg in the case that a client doesn't use their own logo but all the ones i'm testing with do. The path E:\Inetpub\sitename\images does exist and logo.jpg does exist.
Here's the weirdest part, if i change the path from images to image
IE: iTextSharp.text.Image.GetInstance(Request.MapPath("~/image/" & sLogo))
the output will be
E:\Inetpub\sitename\image\logo.jpg
So i have no idea why images doesn't resolve.
Any help is greatly appreciated, and if this answer has been posted before and i just can't find it i'm very sorry, and if you could point me to that i would appreciate that as well.
I figured out my issue, and it's sheer stupidity on my part. The page we call to create the pdf had bad security on it. Basically we were looking for a session variable that didn't exist and redirected that page to a session time out notice. Removed that session check and it's working now!

Should I use X-Content-Type-Options:nosniff on images?

I'm using X-Content-Type-Options:nosniff security header on my project, but it broke my images on IE. All other file types work fine, except of images.
I suspect that IE is handling image differently that type specific in Content-Type header (i.e. image/jpeg). I assume it recognizes images as application/octet-stream as I'm returning array of bytes in my app logic.
One solution is to use nosniff for all content-types instead of images (image/jpeg/ image/png...).
Do you agree this is best solution for this case?
What type IE assumes for image when it is returned as byte array?
Thanks

missing line breaks

I'm trying to include a fb feed on a website using the graph api
ie. https://graph.facebook.com/xxx?fields=feed
This works fine but I noticed when looping through the objects that the actual content is missing layout formatting, especially line breaks. This makes the content of the returned strings rather unusefull for me right now.
Is there another way of retrieving the formatted text, or am I missing something here?
thx!
This works fine but I noticed when looping through the objects that the actual content is missing layout formatting, especially line breaks.
And how are you doing this “looping through”, or rather more important, how are you checking that there are no line breaks?
or am I missing something here?
Well, you wouldn’t be the first one to forget that HTML does just display any whitespace condensed to one space character under normal circumstances …

Solve IE6 static content caching issues on IIS6

I'm currently experiencing problems with static content - most noticeably jQuery datepicker images, but also other static files - which results in images/static content loaded many times - I can clearly see it in IE6 status bar (not to mention SLOW rendering).
The problem and possible solutions seems to be described here: http://www.explainth.at/en/tricks/flickfix.shtml. However, I use IIS6 not Apache, and static files that I don't want to feed through php or asp.
How do I make IE6 cache static images properly? How do I add custom response header for specific files/folders?
Hm, let met re-phrase it. I'm not sure it is caused by the bugs above. Actually, I tried appcmd to apply cacheControlMode/etc and it doesn't seem to work. As far as I remember, IE6 also does not cache for XMLHttpRequest calls? So, the biggest problem that I need to solve is:
in jQuery calendar, moving mouse over image buttons (prev/next) causes them to be reloaded-refreshed
in jQuery dialog, each dialog('open') causes images from theme (like header background) to be re-loaded/refreshed
etc
This link probably gives a better explanation: http://ajaxian.com/archives/internet-explorer-and-ajax-image-caching-woes
How do I solve this - that is, without feeding images through ASP.NET to setup headers?
Thanks everybody for listening, the trick with appcmd seems to work ;-) The problem was that I used jQuery theme from googleapis... which obviously was not affected by appcmd ;-) Moving theme to local folder did the trick. These are the commands:
\Windows\system32\inetsrv\appcmd.exe set config "Default Web Site/images" -section:system.webServer/staticContent -clientCache.cacheControlMode:UseMaxAge
\Windows\system32\inetsrv\appcmd.exe set config "Default Web Site/images" -section:system.webServer/staticContent -clientCache.cacheControlMaxAge:"01:00:00"
from http://forums.iis.net/t/1067723.aspx