IIS 7.5 Compression isn't working - model-view-controller

I am trying to get IIS 7.5 compression working. It sounds so simple by all the blogs, but it isn't working for me. I am using asp.net mvc if that matters. I am testing this locally, and I am using IIS 7.5, not cassini. I have read and tried every article I can find. I have made sure the static and dynamic compression modules are installed. I have tried several articles like this, that talk about setting it up using appcmd. I have tried several articles like this, that configure the settings in the web.config. I have checked the mime types as discussed in articles where js files were only working sometimes (I can't post the link because I am a new user and limited to 2 links). I have created action filters for mvc as discussed in many blogs (again, I can't post the links)
None of the methods are compressing anything. No css, no js, no pages... nothing. I can even step through the code, I see that the action filter is running, I even see it running the following two lines, and yet fiddler shows no compression.
response.AppendHeader("Content-encoding", "gzip");
response.Filter = new GZipStream(response.Filter, CompressionMode.Compress);
I must be having a huge brain fart and missing something really stupid, but I can't figure it out.
Does IIS compression just not run when running locally? Does the IIS compression not work with MVC because of the routing or something?
Any suggestions/tests/info?

Try adding the staticContent element to the web.config.
http://www.iis.net/ConfigReference/system.webServer/staticContent

Related

Sylius works very slow

I installed Sylius on XAMPP (localhost) and pages load very slowly.
I don't know where I can find configuration to solve my problem.
Please help
It will be probably just you environment settings, as well as in this question https://stackoverflow.com/a/17474117/1984346
Try using it with app.dev instead of app_dev.php for a quick check
If it will help, you got you culprit and follow the answers and links bellow.
why is it slow: quote from above answer:
you are by default installing using the config_dev.yml .... When debug is on "cache files are dynamically rebuilt on
each request." This is what is causing the slow speed.
For more information about enviroments: http://symfony.com/doc/current/cookbook/configuration/environments.html
This is a common issue for projects base on symfony framework, sylius out from the box don't take care about the performance.
First is follow the https://symfony.com/doc/3.3/performance.html
Next, more complex is using the Varnish proxy cache.
Also, use elastic search for the catalog, product view pages.
Last one is get rid from the coupled frontend part, but use only API side, where fronted build on top of Angular, React or Vue js frameworks.

SEO with angularjs and asp.net restfull service

I have developed a website using angularjs and web api.
The problem is that the ajax rendered content is not crawable by google. And no one can find the website using google search.
After reading many articles regarding this issue, including:
This one with all links of explanation going out,
Google ajax crawling protocol, and also stack over flow question, I couldn't find the proper solution. Those that mention asp.net solutions, are talking about mvc, and I need only the simple REST by web api, other articles are not talking about asp.net.
Is there any simple explanation?
I'm the one who asked this same question long ago, so I will answer from my experience:
Firstly, if all your content are accessible via unique URIs (including the hashbang if you use it), modern search engines should index it just fine. In fact Google can index javascript generated content now. You can try that via the Google Webmaster tool and see how your site is indexed.
Secondly, there are libraries that help you to serve parsed content to search engines if you need to, but in my case I didn't bother much with it since Google is indexing js nicely.
I've seen others ask this question, and maybe I'm missing something or this is outdated, but I don't see why AngularJS needs to be an issue with SEO.
Say you have a landing page and it has a bunch of links. Assuming you're using html5 mode in AngularJS (and I'm not sure that's 100% necessary) and something like ng-route then the links on the landing page can work both as "angular" (JavaScript) links and "old school" (full page load) links.
If you're a human user you can click a link and it will do angular magic and adjust the content without loading the full page. Ok, all fine.
But if you instead copy the link and paste it in a new tab or new browser, it will still work - assuming you've set up routes correctly.
I'm not an SEO expert by any stretch of the imagination, but as I understand it, having links that load pages and having those pages have real and useful content is the core of SEO, and done this way, AngularJS should work fine. The key thing to check is if you copy and paste the link (not just click it) that it works.

Mediawiki can't display images or styles

I`m using MediaWiki v1.19.1.
My wiki works well when I use it locally.
But when I access it over the network (from another computer, or a different IP),
it displays the text only. There are no images.
It seems like a classic skin but it`s not.
The reason is that there is no layout on my wiki (other public wiki pages show ok).
My wiki uses the monobook skin now, but I can see only the text on the page.
I have changed the permission to 777, including on all directories (/var/www/kj/*),
but still no images.
Help me, please...
I got the same issue some time ago and the following worked fine for me.
The issue might be related to the LocalSettings.php file and the general setting $wgServer.
The following link can provide you more details : Manual of $wgServer
Since 1.18 MediaWiki has also supported setting $wgServer to a protocol-relative URL.
eg, //www.mediawiki.org
This is used for supporting both HTTP and HTTPS with the same caches by using links that work under both protocols.
So try removing localhost and provide your URL; eg ; $wgServer = "//mywebsite.com";
There's not enough information to give a definite answer, however general recommendations for such situations are:
If you're using any Apache rewrite rules (for example, to make URLs prettier), try disabling them.
Especially if you're using the http://example.com/Page_title style URLs, you should know that they're unsupported by the developers and require serious MediaWiki/Apache skills (and even then they will likely introduce subtle bugs).
Install Firebug and check what's the HTTP error for your images: is it because access is denied (HTTP 403) or the webserver doesn't see them at all (HTTP 404) - this should give you an idea what's going on.

SignalR across domains

I'm trying to get a basic sample across domains working, but I just cannot get it to work. According to someone here https://github.com/SignalR/SignalR/issues/6 he got it to work by adding a Access-Control-Allow-Origin header.
Basically, I've added a hub to an mvc 3 application, added the above header in the web.config, and created a page to send a message. This setup works fine.
Next, I've created a different web application using the same client javascript on a page, but setting the url to a different server using:
$.connection.hub.url = 'http://www.myserver.com/signalr';
As soon as I use a remote url it stops working.
How can I get SignalR to work across domains?
Update:
Some added information, the above approach works for chrome and firefox, but IE9 is not liking it...
I got it working using a simple test project and Internet Explorer 9, but it wasn't easy and first I was hung on the same problems you described. I think you are almost there and you are only missing the following line in your JavaScript:
jQuery.support.cors = true;
which tells jQuery to do cross domain calls. Seems simple, but was really hard to find ;-)
I explained all the steps I did in a blog post since I didn't find any existing information on this topic so far.
Tell me if there are any more problems. I have a working test project running in Internet Explorer 9 which I can send you.

How do I create a changing image for my website?

Not long ago I came across this website: http://www.danasoft.com/
This websites provides dynamically updating signatures which are pretty cool in my opinion.
There is just one thing that I don't get and would really like to know how to do.
Here's a direct link to an image on the website: http://www.danasoft.com/vipersig.jpg Try refreshing. Notice it changes? How do I achieve that? How do I have a direct link to a file like www.mypage.com/thing.jpeg output different images each time?
Basically, the URL is not actually retrieving the file directly each time, but rather the server is intercepting that URL and serving a (possibly random) image from a larger set of images. Depending on whether the server is running Apache, IIS, etc, the implementation could vary... This could also probably be achieved with the MVC routing engine by defining a custom route handler for URLs ending in '.jpg', but I'm not actually sure.
EDIT:
See this discussion for more detail on the MVC implementation.

Resources