clear browser cache after deployment - spring-mvc

Hi I am working on Spring MVC application
I have this requirement to clear browser cache or at least prompt user to clear it after every deployment on server
The server I am using is websphere
I am not using any cookies in my application
I am using jsp and not using any versioning on my js files
Can someone please help me on
How can I detect new deployment on server?
I want to prompt user only first time after login when new deployment is detected for all browsers

Related

Lazy loading content web app in amazon EC2

I'll give a context of what happened to understand better. I used Azure services app to keep my application running, but I created a new datacenter on amazon and migrated my web app to the new server.
I use the iis in it to store the application. It's in asp.net and first there was a slow issue with me. bundles, but with this new migration I saw that was too slow to load them, in azure app services took about 200ms, already on the new server was for 3 seconds each bundle on screen, I solved this problem just pointed the way of scripts without using bundle.
The way I did it was a palliative solution and I didn't solve the root of the problem, the loading time on the screens is still a bit time consuming and is spoiling the user experience.
In azure the same application in their service app does not take so long, already on the server running on iis is taking too long and I think it is some configuration but I was not successful.
This is the application in azure:
azure
This is the application in amazon:
amazon
This both examples is the same app, same database and same user account. I believe the problem is not in the application but in the server config.
Someone can help me about that?

WCF Service not working in IIS after Web app migration

I migrated my web app hosting a WCF Service from Windows 10 to Windows Server 2012. I followed the steps below:
Copied the folder where the Web App's files are to the new machine.
Installed all ASP.NET and WCF features.
Created a new application targeting the folder containing the files of the application.
When I try to run the service I get
HTTP 404 Error, The Resource cannot be found.
When I just target the svc file I get
Metadata publishing for this service is currently disabled.
I don't get this message when hitting the same URL in the original machine. Instead I get the regular screen telling me that I have created a service.
When hitting the root folder on a browser, in the original machine I get a white screen but in the new machine I get
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
As far as I can say, all configuration parameters are the same in both machines.
I want to add a detail that might help. When I restart the site on the original machine, the first time I request the service, I wait a few seconds for the site to compile and run. On the new machine this doesn't seem to happen. It may be that the code-behind is not loaded at all.
Please check if your IIS has svc handler added.
WCF services don’t run on IIS with the default configuration, because the webserver doesn’t know, how to handle incoming requests targeting .svc files. You can teach it in two steps:
Add a new MIME type:
Extension: .svc
MIME type: application/octet-stream
Add a new Managed HTTP Handler:
Request path: *.svc
Type: System.ServiceModel.Activation.HttpHandler
Name: svc-Integrated
Refresh your website/web application
References:
http://gyorgybalassy.wordpress.com/2012/09/24/publishing-a-wcf-service-on-iis8/
http://proq.blogspot.hk/2012/09/wcf-on-iis-and-windows-8.html
http://forums.iis.net/t/1200413.aspx?+svc+missing+can+t+find+Module+to+load+within+Handler+Mapping+IIS+8+0
Enable FTP Server from Control Panel->Programs and Features
http://www.kebabshopblues.co.uk/2013/09/20/hosting-a-wcf-service-library-project-in-iis-8-0-windows-8-0-net-4-5/
From Control Panel|Programs and Features, enable the following:
Internet Information Services (a number of contained items will be selected automatically, but not all, most notably the FTP Server);
‘HTTP Activation’ under ‘.Net Framework 4.5 Advanced Services | WCF
Services’ (there is a fairly similar option ‘Windows Communication
Foundation HTTP Activation’ under the ‘.Net Framework 3.5 (includes
.NET 2.0 and 3.0’ which I guess would be necessary if you were
targeting an earlier version of .Net);
There may be some features that support WCF that are not yet enabled in IIS. I have followed your steps to deploy the existed WCF service and consume the service successfully. Here are my features I have enabled in IIS.
Result.
Feel free to let me know if there is anything I can help with.

How to restart an ASP.Net Application automatically when it goes down

I have developed a asp.net application which is deployed on his personal server. The application is running in the background and updating his e-commerce database automatically. I have used Quartz.net for scheduling purpose.
My problem is that the application gets stopped after certain period (3-8 hours) of time.
I want a way to restart the application automatically as soon as it goes down.OR alternatively a service which visit the application periodically so it goes live.
Note: I have access to my client server and can yous windows scheduling if there is any solution relatively.
I have also read similar post but had no luck.
Your prompt response will be highly appreciated.
Thanks

Flex app not hitting web service

I have zero knowledge on flex and need help to determine what is preventing my web service from being called.
We have a working application in production and the developer who wrote it has left.
I am trying to build it on my machine and I can see a web service call in fiddler being made with the URL "/Services.asmx/MethodName" (as a GET request).
I have set my break point in the asmx web service and it is not being hit. All I get in the flex front end is a pop up with " The remote server failed to respond and may be offline. http://MachineName/Services.asmx/MethodName"
The web service is in the same application as the web app that hosts the SWF file.
I have the cross domain policy file in place.
What I noticed in fiddler is the URL is "/Services.asmx/MethodName" and not "/WebApp/Services.asmx/MethodName" (not sure if this makes a difference) where WebApp is the IIS virtual directory to the web application that hosts the SWF.
Any ideas?
JD
If you are Web-services and your web-application is same domain then just pass the whole path like "http://..../Services.asmx" for creating web-service api instance in ActionScript 3.0 (for flex). and use this instance name to call your web-service method.
Please read this article from Adobe help for your perfect answer

How to warm up an ASP.NET MVC application on IIS 7.5?

We would like to warm up an ASP.NET MVC application hosted on IIS 7.5 server. The warm up module that used to be available at http://forums.iis.net/t/1176740.aspx has been removed since sometime.
The application should be warmed up everytime IIS or ASP.NET worker-process restarts for any reason. During the warm up period, IIS should return some HTTP status code signifying its warm up state or its inability to serve any clients.
Would creating a executable that navigates through necessary pages in the site via HttpRequests be a good idea? The executable can be triggered from IProcessHostPreloadClient implementation. Is it possible to configure IIS so that it would only accept requests from localhost and once the executable is done, it can switch over to all clients - but that switch should not trigger an IIS restart (obviously).
Is it possible to use an Visual Studio 2010 - Web Performance Test to warm-up an application instead of creating an manual executable? Any other alternatives?
PS: The application uses Forms Authentication and uses sessions - so maintaining state cookie and other cookies is important.
UPDATE 1 - We are using .NET Framework 4.0 and Entity Framework (database first) in our application. The first time hits to EF queries are slow. The reason behind the warm up is to get these first time hits out of the way. We are already using compiled queries at most places and we have implemented pre-compiled views for EF. The size of the model and application is very large and complex. Warm up needs to walk through many pages to ensure that compiled and non-compiled EF queries get executed at-least once before any end user gets access to the application.
Microsoft has released a module that does exactly what you ask for. The Application Initialization Module for IIS 7.5 improves the responsiveness of Web sites by loading the Web applications before the first request arrives.
You can specify a series of Urls that IIS will preload before accepting requests from real users. I don't think you can get a true user login expereince, but maybe you can set up simulated pages that does not require login that fulfills the same warmup you ask for?
The feature I think is most compelling is that this module also enables overlapped process recycling. The following tutorial from IIS 8.0 include a step-by-step approach on how to enable overlapped process recycling.
When IIS detects that an active worker process is being recycled, IIS does not switch active traffic over to the new recycled worker process until the new worker process finishes running all application initialization Urls in the new process. This ensures that customers browsing your website don't see application initialization pages once an application is live and running.
This IIS Application Initialization module is built into IIS 8.0, but is available for download for IIS 7.5.
You may take a look at the following post for the Auto-Start feature built into IIS 7.5 and ASP.NET 4.0.
Any application that generates a server request for the hosted resources can be used to warm up an IIS process. Exactly how many requests you need depends on what parts need warming up. Typically, warm-up is used for:
Starting up a worker process. For this, you only need to ask for one resource to warm up a process for the entire application.
Perform any static initialization, database startup, or pre-caching. Anything you do in your Global.asax file will happen when you do your first request, so if you can make all of your initialization happen then, you'll still only need to make one page request.
Force pre-compilation of ASP.NET pages. For this to happen you would need to hit every page. Fortunately, this is typically not much of a time cost, so you likely don't need to worry about it. If you do have individual pages that load slowly, you can warm them up separately.
The "warm-up" process here isn't anything magical. You just need force IIS to serve the URL in question. Everything you mentioned would take care of that: using a stress-test tool to query the URL, writing a custom utility to post HTTP requests, even just scripting out a tool like 'wget' or a PowerShell script to download the URLs would do it.
As far as restricting access to localhost, as far as I know, within IIS, the only way to change that requires you to restart IIS. You could always build a pre-request hook into your application and maintain the state there, and have your warm-up process query some specific URL that toggles that state to "open". But I'm not sure what you would accomplish. If, somehow, a user did try to query your site before your warm-up finished, all that would happen is your site would take a long time to respond, then they would eventually get the page they asked for. If you locked them out of the site during warm-up, they would instead get a browser network error that claimed the site was offline, which (to me) sounds much worse.

Resources