ImageResizer does not redirect local image url to azure cdn url? - imageresizer

I have the following configured in my web.config:
<resizer>
<clientcache minutes="1440" />
<plugins>
</plugins>
<plugins>
<add name="AzureReader2"
connectionString="DefaultEndpointsProtocol=https;AccountName=myaccountname;AccountKey=myaccountkey="
endpoint="https://az824306.vo.msecnd.net/"
prefix="~/" />
</plugins>
</resizer>
I have a directory called bdgtpd under the root of my website and in there I have one image 40420_1.png.
I also have this image on azure located at:
https://az824306.vo.msecnd.net/bdgtpd/40420_1.png
Initially, I had my src set to https://az824306.vo.msecnd.net/bdgtpd/40420_1.png, but when I tried to apply something like https://az824306.vo.msecnd.net/bdgtpd/40420_1.png?width=300, it did not work.
So then I set it to:
<img src="~/bdgtpd/40420_1.png?width=300 />
and this does resize the image, but when I look in the chrome console, I can see it is grabbing the image from my local folder. Maybe I don't understand the AzureReader2 plugin, but I thought it when it sees:
http://localhost/bdgtpd/40420_1.png?width=300, this would be fetch the image from https://az824306.vo.msecnd.net/bdgtpd/40420_1.png and apply the transformation.
Am I setting my src right? Should it be a local url or the cdn url?
Ok, so I deployed ImageResizer along with AzureReader2 to my staging server and I am pointing my images to my staging server. When I set the prefix to ~/, the site threw 404 error and there were messages such as Blob Not Found. All the images on the home page are in the CDN. When I make the prefix ~/azure/, it works fine, so I am not sure what is going on here.
I was looking at the could architecture documentation, but I am confused on a couple things:
Right now I have one image that has the ~/azure/ prefix path set, so when I look in the chrome console under the network tab, I see the initiator is my staging server path, but the image is actually being pull from the cdn. It would be great to have a simple explanation of what is happening.
When I use clientcache, if a user requests the same image from the cdn, how is the image delivered? I wasn't sure exactly how this works?
Thanks so much

If ImageResizer is running on localhost (for example), then your URLs should point to localhost. Azure doesn't have any magic ability to understand ImageResizer commands and execute them; you have to talk to the server with ImageResizer installed.
You should configure AzureReader2 with a prefix (like /azure/), although it appears you've discovered that this works?

Related

Akamai CDN Issue with URL Query Parameter

I am working on a client project, where the AKAMAI CDN has configured. They got Amazon S3 for hosting.
Problem:
I've committed the code in branch and could see the changes deployed on server in a codebase
Now I am trying to hit server URL in browser and trying to verify my code change
I couldn't see the UI change as per
I observer the CSS file URL is coming with query parameter (i.e.: server.com/css/filename.css??browserId=other&themeId=AbcTheme_WAR_abctheme&?t=125786954258&languageId=en_US&b=8569&t=1259648753695)
Now I am opening same URL in browser but now removing url query parameters from the file
This time I could see my changes in the same file
Questions:
Is this an issue related to CDN?
Is the CDN managing different versions of the same file to be served?
If so my changes should be merged into the latest file pointing to a webpage, which has url query parameters.
I know CDN will take time to refresh the pages but I am trying to verify my changes after 48 hours of the deployment.
Any help would be appreciated.
Thanks.

Enabling browser caching in wildfly 8

How can I configure Wildfly to Leverage browser caching? I know this can be done in apache through htaccess, but how to achieve same in wildfly.
I tried to create .htaccess file and place it in both the wildfly's deployement folder and in my project directory one by one but nothing worked.
We need to add the cache control filter in the standalone.xml file.
The following link explains it all.
Leaverage browser caching

Configuring ImageResizer to run as an Azure virtual application

I am trying to configure ImageResizer to run as an Azure virtual application so that it will run in the same web role as our main MVC application but a separate worker process. It appears that AzureReader2 isn't flexible enough to accomodate this.
An Azure virtual application adds an additional subfolder to the url and so does ImageResizer.
The following url results when using the Azure emulator is used and the Azure virtual application name is set to "ir" and the default subfolder of "azure" is used for the AzureReader2 plug-in:
http://127.0.0.2:81/ir/azure/datstat-resources-17/94fdf833-d457-4ed5-bce1-abf403381460.jpg?width=400
This example works just fine. The problem comes when NO query string is specified and the request is redirected to use blob storage. When I remove the query string the following url is produced:
http://127.0.0.1:10000/devstoreaccount1/re/datstat-resources-17/94fdf833-d457-4ed5-bce1-abf403381460.jpg
I'm very confused as to how this url is formed. What I want is for the "/re" subfolder portion to be removed from the url.
Here are my AzureReader2 web.config settings:
<add name="AzureReader2" connectionString="UseDevelopmentStorage=true" endpoint="http://127.0.0.1:10000/devstoreaccount1/" />
Is there any way to fix or control the way this url is formed?
This bug has been fixed in the latest development version, and will be included in the next release.
The blob redirect path is incorrect for any application not mounted at the domain root.
E-mail support#imageresizing.net to get a hotfix and claim your bug report reward.

WebLogic Virtual Directory Mapping Not Working

I am having a frustrating problem with virtual directory mapping in my very simple WebLogic 11g application. I installed WebLogic 11g OEPE, which installs WebLogic Server 10.35. I believe that this is installed correctly, because I am able to deploy a much more complicated application that is working fine...except for my issue with virtual directory mapping.
I want to access files from a directory outside of the web application, H:\Backup.
Here is my entire application, and these are my exact files.
wl_test/index.html
<html>
<head><title>WebLogic Test</title></head>
<body>
<h1>This is another new test<br>
</body>
</html>
wl_test/WEB-INF/web.xml
<web-app>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
wl_test/WEB-INF/weblogic.xml
<weblogic-web-app>
<virtual-directory-mapping>
<local-path>H:/Backup/</local-path>
<url-pattern>/files/*</url-pattern>
<url-pattern>*.txt</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>
When I access the HTML file, 'http://localhost:7002/wl_test/index.html', it loads perfectly fine.
However when I attempt to load either of the following two URLs, they both fail with a HTTP 404 error. And yes, both of those files, one.ini and asdf.txt exist in the H:\Backup directory.
'http://localhost:7002/wl_test/files/one.ini'
'http://localhost:7002/wl_test/asdf.txt'
What could be wrong with this trivial setup?
I'm beginning to think I don't understand how this is supposed to work.
I think I understand what has changed and how to fix everything.
There were two problems with the virtual directory mapping.
First, the local-path cannot be a MS-DOS SUBSTed drive. I don't understand why, but WebLogic doesn't like it.
Second, when the url-pattern contains a folder, like /files/*, that folder must exist in the local-path directory.
Both of these are allowed in the JRun server that this is being ported from.
Sigh,
Randy Stegbauer
I think there is something a little goofy about the combination of multiple url-pattern elements. Here's a sample showing the shared 404 file from my archives.
Part of the NotFoundWeb.war/WEB-INF/web.xml looks like this:
<error-page>
<error-code>404</error-code>
<location>/error/404.html</location>
</error-page>
Part of the NotFoundWeb.war/WEB-INF/weblogic.xml looks like this:
<wls:virtual-directory-mapping>
<wls:local-path>d:\temp\notfound</wls:local-path>
<wls:url-pattern>*.html</wls:url-pattern>
</wls:virtual-directory-mapping>
I have a file on the file system:
d:\temp\notfound\error\404.html
So at runtime when I type something like:
http://localhost:7001/NotFoundWeb/somebadurl
I get the error page from the file system.
The generatedReports and /app/reports are local folders in the file system. This way, you can put any type of files inside the generated Reports folder:
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
<weblogic-web-app>
<container-descriptor>
<index-directory-enabled>true</index-directory-enabled>
</container-descriptor>
<virtual-directory-mapping>
<local-path>/app/reports</local-path>
<url-pattern>/generatedReports/*</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>

Help With 301 Redirection on Plesk Servers (eUk Host Specifically)

I am running around in circles here, I wonder if anyone can help.
I recently moved a static html website to Umbraco. It is running on a Windows plesk shared plan.
I need to put in place 301 redirects for the old content to the new but:
Umbraco won't receive requests for.html, there doesn't appear to be a way to do this.
I can't get any server side running in the .html files that the plesk supports as custom error docs.
I was going to use client side meta redirects, but wasn't sure if Google etc will read these right?
I haven't used it myself, but the Umbraco 301 Moved Permanently project looks like it does what you need.
The real trick will be piping all requests for .html files through ASP.Net. I'm not sure if this can be done with your web host. But some tips can be found here:
http://our.umbraco.org/projects/developer-tools/301-moved-permanently/feedback/7271-when-the-old-pages-are-not-from-umbraco
p.s. You are correct that a client-side redirect will not help with SEO.
you could add a rule in to your UrlRewriting.config the file sits here in the Umbraco installation... "~config/UrlRewriting.config"
The rule would strip the .html extension from the page request. And would look something like the following...
<add name="removehtml"
virtualUrl="^~/(.*).html"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/$1"
ignoreCase="true" />
You would also have to make sure that the web.config file had the following key set to true
<add key="umbracoUseDirectoryUrls" value="true"/>
This would allow you to recreate your url structure with nodes inside the umbraco cms without the html or aspx extension. If all this seems too complex you could individually add each page you want to listen for to the corresponding node in the URL Alias property (umbracoUrlAlias). Umbraco will take this and redirect to your page.