The following cacheable resources have a short freshness lifetime. Specify an expiry of at least one week in the future for the following resources:
http://pagespeed.googlelabs.com suggest me this for my website as a high priority. I am using windows server 2008 r2 netframework 4.0 asp.net IIS 7.5 . How do i do this ?
This is the direct url for you to see : http://pagespeed.googlelabs.com/#url=www.monstermmorpg.com&mobile=false&rule=LeverageBrowserCaching
You might start here with this article, also Mads Kristensen had written an interesting blog post on how to compress, minify and cache dynamic and static content on your website.
<configuration>
<location path="showStockPrice.asp">
<system.webserver>
<caching>
<profiles>
<add varybyquerystring="*"location="Any"
duration="00:00:01" policy="CacheForTimePeriod"
extension=".asp">
</profiles>
</caching>
</system.webserver>
</location>
To cache static content
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00"/>
</staticContent>
Related
Larvel website hosted on Windows server 2012 R2 but I am not able to delete Attachments in the website.
Please refer screenshot now
Error message
Request URL:http://13.232.72.80/api/delete-form-data/form-field/33
Request method:DELETE
Remote address:13.232.72.80:80
Status code:
405
Version:HTTP/1.1
Referrer Policy:no-referrer-when-downgrade
image
Do you want to call asp.net web api with delete method?
If this is your requirement, I suggest you could try below solution to solve this issue.
1.Open your IIS manager and locate the web sites and find the hanlder mapping. Find ExtensionlessUrlHandler-Integrated-4.0, double click it. Click Request Restrictions... button and on Verbs tab, add both DELETE.
2.Remove the WebDAVModule for your web application.
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
</system.webServer>
We are migrating one of our websites to Azure which was previously setup using ARR (Application Request Routing) as a caching reverse proxy. It was setup as a reverse proxy which would honor the cache headers of the site it was proxying.
I've followed this guide on using an Azure website as a reverse proxy and it all works fine except that it doesn't honor the cache headers of the site it is proxying. I tried adding some more pertinent elements to my applicationHost.xdt, but nothing I do seems to have any effect.
Here is the relevant section from my applicationHost.xdt:
<system.webServer>
<caching xdt:Transform="Replace" enabled="true" enableKernelCache="true" maxResponseSize="1000000"></caching>
<proxy xdt:Transform="InsertIfMissing" enabled="true" reverseRewriteHostInResponseHeaders="true" minResponseBuffer="4096" responseBufferLimit="12392">
<cache enabled="true" queryStringHandling="Accept" validationInterval="00:01:00" />
</proxy>
</system.webServer>
and here is my web.config:
<system.webServer>
<rewrite>
<rules>
<rule name="CurrentTime" stopProcessing="true">
<match url="^times/?(.*)" />
<action type="Rewrite" url="http://example.com/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
The web.config just routes all requests to /times to example.com. That part is working great. It is just ignoring the cache headers of example.com and not caching anything which is the main use case of why we want to setup a reverse proxy.
This same configuration works just fine on a normal machine with IIS and ARR installed.
I'd really like to get this working in azure websites without having to use a web role in a cloud service. I'm hoping this is possible.
Did you try to specify the preserveHostHeader="true" flag as follows?
<proxy xdt:Transform="InsertIfMissing" enabled="true" preserveHostHeader="true" reverseRewriteHostInResponseHeaders="true" />
I'm developing a web application in Visual Studio 2013 and am getting my data from an external server. For this reason I disable the web securtiy in my browser and define absolute URLs in my application. Now whenever I'm deploying the applicaiton, I have to adopt the URLs (which of course get's forgotten the first time) and also I have to explain the setup to evey person new in the porject.
After getting a bit fimilar with the web.config file, I tried to setup some rules, to rewirte this urls to the data webserver, but failed.
All my relative urls start with the same identifyer, and should be mapped to an external server. This is what I have so far:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite calls to rest.oms to the actuall webserver">
<match url="^/IDENTFIER/([_0-9a-z-]+)" />
<action type="Rewrite" url="http://EXTERNAL_SERVER/IDENTFIER/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
However, it is not working so far. Can somebody help me please.
Best Regards,
Stefan
It is possible to rewrite from external url, if you have ARR module.
1) You need to install ARR module for your IIS
2) In IIS manager you should enable reverse proxy
2.1) On server node click "Application Request Routing Cache"
2.2) Click "Server proxy settings" and click "Enable proxy", then "Apply"
3) Slightly fix your rewrite rule regexp (remove starting slash):
<rule name="Rewrite calls to rest.oms to the actuall webserver">
<match url="^IDENTFIER/([_0-9a-z-]+)" />
<action type="Rewrite" url="http://EXTERNAL_SERVER/IDENTFIER/{R:1}" />
</rule>
Then your rule should work.
I have a site running on iis7.5 where, through Firebug, I can see that my static content (css, js and images) have an expiration in their header consistently set to one day in the future. I find no where this is set, but I just came on recently to the project.
I want to make the expiration further in the future, so added a section in the web.config:
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="100.00:00:00" />
</staticContent>
</system.webServer>
After restarting the site, this had no affect on the expiration date of these items.
My question is, what can override the clientCache setting, imposing a different expiration date?
Thanks,
Matt
I have a main website app written in ASP.NET's MVC 3. Now, what I would like to do on occasion, is add a subdirectory, mark it as an application and run a whole different MVC 3 app from that directory. For instance, my site is at http://sol3.net. I am working on a small MVC app for a client and I'd like to publish it on my site so he can take a look at the progress, offer feedback, etc. So, their site would be at http://sol3.net/projectA. Having done this with a test app all I am getting is a 500 error.
Are there any best practices on how to set this up?
And yes, I already know about web.config inheritance problems. Fortunately my web.configs are not too large and I think I have most everything handled there.
NOTE: What I am trying to do is temporarily run a MVC app (App B) from within an app folder on an already active site (App A). App A and App B do not share anything in common and App B will eventually be moved to its own hosting site.
NOTE #2: The Answer...
I believe it is IIS7 and higher that allows you to add a redirection in your root web.config. Here is what I ended up doing instead of doing it via IIS Manager:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<rewrite>
<rules>
<rule name="APP 1 - Sub domain to sub folder" enabled="true">
<match url="(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(www\.)?app1\.sol3\.net$" ignoreCase="true" />
</conditions>
<action type="Rewrite" url="app1/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
You would add a subdomain via an alias in your DNS records. Some registrars will let you do this yourself, but some sell this as a feature. A whois on your domain says it's registered with GoDaddy. Check this out. http://help.godaddy.com/article/4652#addsubdomain1
Edit - OrcsWeb allows for remote management of your web site via IIS 7 Manager. This should allow you to edit the host header. http://www.orcsweb.com/blog/brad/iis-7-manager-for-remote-administration-installing-and-connecting-to-a-site/