I enabled in IIS manager-> MySite -> HTTP Response Headers -> Set Common Headers -> Expire Web Content -> After 7 days.
This is correctly reflected in web.config. By the way both Google Page Speed online and Google Page Speed as Firebug extension are saying "expiration not specified".
This setting impacts static content only not content generated by engines like asp and asp.net.
In additional IIS7 does not send the Expires header when responding to a HTTP/1.1 request, instead it uses the Cache-Control header instead.
In ASP-Classic you should use the Response.Expires property and the AddHeader method to add the Cache-Control header. In ASP.NET the Response.Cache property exposes an object that has number of properties through which you can control caching both at the server and client end.
Related
We have 2 Microsoft add-ins written using the Office JS framework.As we understand we are loading the static website (taskpane.html) whenever the pane is loaded.
Changes to our plugin are mostly cosmetic, and due to that we usually do not update the version of the plugin, and just push a new version of code to the bucket hosting the static website.
The issue we are facing is with caching of the build bundle, unless we manually clear the cache using developer tools, we do not get the updated website inside the plugin pane.
We have disabled the caching at S3 end to return Cache-Control header value as no-cache, but even after that I see http status code 304 on plugin refresh against the task.html code.
Are we supposed to distribute a new version of plugin event for website updates ?
Are we supposed to distribute a new version of plugin event for website updates ?
No, that is not required.
We have disabled the caching at S3 end to return Cache-Control header value as no-cache
But the loaded by the web browser files are already cached on the end user machine. To get them requested anew you need to clear the cache for users. Only after that you will get new requests according to the HTTP headers set on the server. Note, the Cache-Control header field holds directives (instructions) — in both requests and responses — that control caching in browsers and shared caches (e.g. Proxies, CDNs).
It is not clear what directives are used for the Cache-Control HTTP header.
I'm using IIS to serve static files and also to send API requests to a python backend server.
for API requests the backend correctly sets CORS-related headers but for static files, I get errors. additionally, I can't set these in Response Headers in IIS because it conflicts with those set with the backend app.
So is there any way in IIS to check if some certain header is empty or requested response is a file or even check URI for a pattern like /static/ and then modify the response header?
I've reached to URLRewrite so far but I doubt it could modify the header.
after a little bit of digging it turned out you can set Response Header specific to each directory. so I set the CORS-related headers in my ./static/ sub-directories and it works fine.
I have a website which sits on a non-public domain and is delivered via a proxy through on a different domain. We're having some trouble with caching of content - this is an Umbraco site and making changes updates the pages if you hit the domain directly, but not through the proxy.
I've been informed that the proxy honours response headers and setting an eTag would fix the issue. Having looked into this I can see that IIS sets the eTag by default, and I can see this is working on static content i.e. .js, .css files like so:
However, if I visit a page on the site, for example /uk/products/product I don't see the eTag header.
Is this expected behaviour, should it only be working with those static content files or can I set this on the page to tell the proxy that it should recache?
The ETag HTTP response header is an identifier for a specific version of a resource. It lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed. Additionally,etags help prevents simultaneous updates of a resource from overwriting each other ("mid-air collisions").
If the resource at a given URL changes, a new Etag value must be generated.
Static content does not change from request to request. The content that gets returned to the Web browser is always the same. Examples of static content include HTML, JPG, or GIF files.
IIS automatically caches static content (such as HTML pages, images, and style sheets), since these types of content do not change from request to request. IIS also detects changes to the files when you make updates, and IIS flushes the cache as needed.
to enable caching in iis you could use iis output caching feature:
1)open iis manager. select site.
2)select the output caching feature from the middle pane.
3)select edit feature setting from the middle pane.
4)check the enable cache and enable kernel cache box and click ok.
if you want to set the ETag as blank you could also do by adding below code in web.config file:
<httpProtocol>
<customHeaders>
<add name="ETag" value="" />
</customHeaders>
</httpProtocol>
refer this below article for more detail:
Caching
To use or not to use ETag, that is the question.
Configure IIS Output Caching
I've read that IIS after version 7 automatically enables E-tags, however, I ran a Pingdom speed test and the report advised me to enable E-tags. I'm not sure that report is accurate, or the information I read about IIS 7 and newer may not be correct.
I would like to access the raw files in a repository of mine that is on gitlab through an ajax request. However, it's not working, I'm wondering if I have to setup my project accordingly or something. Obviously my project is public. This is the error message I get :
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Which means it's on their end.
To understand Access-Control-Allow-Origin header, I highly recommend How does Access-Control-Allow-Origin header work?
When Site A tries to fetch content from Site B, Site B can send an
Access-Control-Allow-Origin response header to tell the browser that
the content of this page is accessible to certain origins. (An origin
is a domain, plus a scheme and port number.) By default, Site B's
pages are not accessible to any other origin; using the
Access-Control-Allow-Origin header opens a door for cross-origin
access by specific requesting origins.
If your GitLab is hosted on gitlab.com, I don't see a way to add your domain to response header.
The easiest solution is wrapping XMLHttpRequests to GitLab in requests to your application - and on the backend you will simply fetch and return data. For example, you won't send a XML request to https://gitlab.com/pdaw/test/raw/master/README.md, but tohttps://my.app.com/fetch-file?file=pdaw/test/raw/master/README.md. On the backend of the fetch-file action you will fetch and return raw data from https://gitlab.com/pdaw/test/raw/master/README.md
I want to enable GZip compression on my controller actions using IIS's doDynamicCompression configuration option.
The question is what will happen if one of my users uses a browsers that doesnt support GZip - would IIS detect it and send it uncompressed?
When your users send request to the serveur, the Browser send a header Accept-Encoding.
This header specifies to the server with compresssions methods are accepted by the Browser.
For exemple "deflate,gzip", "gzip" or nothing.
IIS parses this Header to compress or not the response.