Caching problem - iis

I have a web page with a set of images and java script files.
I want to cache all the images+java script other than a single image which is the logo.
Is this possible ? and how would I do it ?
I am using IIS server.

Yes. Just configure your server to have a default cache configuration for images and JS, and then override it for the logo. Possibly with a <file> block if you are using Apache.
See this decent caching tutorial.

Related

In angular 2 app how can I cache certain local resources e.g. scripts

In angular 2 app how can I cache certain local resources e.g. scripts
Can I use a .htaccess file at my route?
I have an app thats live and when I run a speed page test with gtmetrix.com
I get an issue with leverage browser caching and it says to cache some of my resources as I'm making too many requests even though these resources are stored locally with the app.
I'm not sure if an angular2 app can have a .htaccess file? or what it would look like for a file.
If I cannot use a .htaccess file can you let me know other ways please.
Thank you
.htaccess is configuration for the server, so if you host your app on apache-server you can use a .htaccess -file
Angular can not help you cache files such as images
If the requests are for multiple js-files that are angular components of your app you should look at bundling your scripts into fewer files.
If you are a beginner i recommend you build your app using angular-cli that can help you with a build workflow.

Can Cesium map run on Apache HTTP server instead of node.js environment?

I have an Apache HTTP server that handles all my requests for a Ruby on Rails project. We are thinking of adding a Cesium map component. I am wondering if I can run Cesium on the Apache HTTP server instead of setting up a node.js environment?
Yes, Cesium is completely client-side and can be served by any HTML server.
I have it running in JBoss. All I did was take the contents of the ZIP file and dropped them into the deploy area of JBoss under a Cesium.war directory.
Works like a champ...

Using CDN with Liferay

We are using CDN for our custom theme. Now we want to do same for all Liferay static resources(js,images,css and fonts). Has anyone done this before? We are planning to move whole /html of ROOT to CDN. But we faced some issues regarding compass from some css files which imports compass. What is the ideal scenario while uploading Liferay's static resources to CDN? Any help? We are using cdn.host.http in portal-ext.properties.
Do not move resources from the webapp to the CDN! A lot of those things are not actual resources, but more of a ‘source’! For example, the css in the ROOT/html are actually SASS files and will not work if moved as is. The best solution is to use a Squid-like proxy to cache resources from the actual tomcat portal as they are requested.

Minify resource files with IIS, when using Java and .JSP

I was recommended that I move this question from StackOverflow to here.
I am running a web site on a server with Tomcat and IIS. I use .JSP and Java in the back end.
I don't know how to configure IIS to automatically minify resource files (CSS, JavaScript, images) when using .JSP. I have found a few suggested solutions online, but they all apply to IIS and .ASP.
I added the "compression" tag to this post because there is no "minification" tag available, but I am not referring to gzip compression, but removing white spaces, merging resources for faster download etc.
Could anyone help me figure out how to configure IIS to minify resource files with .JSP? Thank you!
Minification a process which combines multiple CSS or JS files to a single file and perform process of compression(whitespace removal) and obfuscation(JS) is an ideal build time solution, rather than a run time solution. While using Tomcat with IIS, it will be good to have some thing like this:
Use WRO4J as a maven build time plugin. Create an attribute like
devmode=true or false. In JSP's have if else condition to define
groups to add multiple CSS/JS or Single based on the devmode value.
While deploying use devmode = false. This with maven configuration will compile JSP with single CSS/JS files.
In IIS, configure a separate VD and map your static resources of war to it. Write a rewrite rule to instruct IIS to serve the static resources. Enable static compression.
The above said configuration will take less load on the CPU.
Some links of interest could be:
https://code.google.com/p/wro4j/wiki/MavenPlugin
Unobtrusive way to combine and compress javascript/css for java/spring/maven applications?

.do extension in web pages?

I want to know what is .do extension in web pages. Is it a standard extension, or, if it's not, can we change the extension (like client-login.php to client-login.do and still run as PHP)?
Thanks.
.do comes from the Struts framework. See this question:
Why do Java webapps use .do extension? Where did it come from?
Also you can change what your urls look like using mod_rewrite (on Apache).
".do" is the "standard" extension mapped to for Struts Java platform. See http://struts.apache.org/ .
It is whatever it is configured to be on that particular web server. A web server could be configured to run .pl files with the php module and .aspx files with perl, although that would be silly. There are no scripts involved with most web servers, instead you'd have to look in your apache configuration files (or equivalent, if using different server software). If you have permission to edit the server config file, then you could make files ending in .do run as php, if that's what you're after.
Using apache's rewrite_module can change your script extensions. Give this thread a good read.

Resources