How to delete the old files that are created with change in the js and css files without manually cleaning them everytime using SquishIt framework - asp.net-mvc-2

I am working on asp.net mvc2 project. Due to some limitations I cannot migrate the code to asp.net mvc4 version and due to this I am not able to use the Bundling and Magnification feature for bundling and minifying the js and css files. I used the SquishIt framework to work on this. Can anyone help me to know are there any other good options other than SquishIt framework to work on this task.
I used the following url to implement SquishIt framework:
http://www.codethinked.com/SquishIt-The-Friendly-ASPNET-JavaScript-and-CSS-Squisher
Can anyone help me know how to delete the old files that are created with change in the js and css files without manually cleaning them everytime.
Thanks & Regards,
Santosh Kumar Patro

The best solution for this is to not include the hash in your filename (I assume you are rendering to filename_#.ext). You'd just need to remove the '#' from your rendered filename, then SquishIt will use querystring invalidation by default. This will only keep a single copy of each bundled file on disk. If querystring invalidation won't work for you there is also a relatively new option that allows you to place the hash into the path as a directory, then scrub it out with an IIS rewrite rule.
For more on SquishIt's support for different cache invalidation strategies read this

Related

Keycloak CSS is not updating in browser

I am upgrading Keycloak from 9.x to 12.x in a development environment. I initially copied some custom themes forward, and found that the styling was badly broken (no surprise). I reviewed my FTL files, copied some of the core changes into my theme, and things are much better - just some minor issues to adjust.
Now the problem. I've made the changes to my login.css file, but those changes aren't showing up in the browser. It continues to fetch an old version of my custom CSS file.
What I have tried (multiple times for most of these):
Clear browser cache
Restart Keycloak
Check ownership/permissions of theme files
Restart entire server
Load CSS file directly
Load CSS file directly with meaningless parameter added (trying to bypass any possible middleman caching)
Confirm new version of Keycloak is the one running
Load page in other browsers
I've also now grepped the entire Keycloak directory for some of the CSS rules I've removed, and I can't find any copies of the "old" css file anywhere that might be getting referenced by accident.
Also, there are no messages in the Keycloak log when loading the CSS file.
I want to figure out how to get Keycloak to deliver the updated CSS to the browser.
Blind guess, so please don't blame me if it doesn't work. (question should include minimal reproducible example):
Edit /opt/jboss/keycloak/standalone/configuration/standalone-ha.xml and update it as follows:
<theme>
<staticMaxAge>-1</staticMaxAge>
<cacheThemes>false</cacheThemes>
<cacheTemplates>false</cacheTemplates>
...
</theme>
For me it worked when changed this file
standalone.xml
like below way
<cacheThemes>false</cacheThemes>
<cacheTemplates>false</cacheTemplates>
I think it is because I am using single instance mode instead cluster ha mode.
Apart from disabling cache, as described above, you can also adjust the theme resource URLs, breaking the client-side cache. It's a bit of a hack, but you can directly modify the resource tag portion of the URL by adjusting the database migration_model.id value.
references:
https://github.com/keycloak/keycloak/blob/main/model/jpa/src/main/java/org/keycloak/models/jpa/MigrationModelAdapter.java
https://medium.com/#hokumski/how-to-drop-keycloak-theme-cache-without-clearing-browser-data-aebb499ae83b
You must delete the path keycloak-server\standalone\tmp\kc-gzip-cache\sbgwq or otherelse folder... and test in a browser in incognit mode.

How To Change target paths for thousands of products at once

I am using Magento 1.7.1 and find that magento has automatically added ugly urls like www.afd.com/catalog/product/view/id/2728/name.html.
When I go into catalog > URL Rewrite, I see the target paths for all my products listed in the above totally unfriendly way with id numbers displaying.
How do I fix this en masse?
Thanks.
-TM
Try to do it by using a .csv file. You can create a php file which will run outside your project and do the expected changes via a csv file. Also hopes this will help to grab an idea. http://www.solvingmagento.com/magento-url-rewrites/
Refresh all indexes in magento, here is instrucion http://www.inmotionhosting.com/support/edu/magento/102-customizing-magento/how-to-reindex-your-magento-website, then flush all cache. Then magento should use Url Rewrites. If doesn't work make sure that you heve proper settings in
System->Configuration->Web->Search Engine Optimization

Deploy GWT Application as Single JavaScript File

The compiled JavaScript output of a GWT application is divided into various files, for instance
*.cache.html
*.gwt.rpc
hosted.html
*.nocache.js
...
I know this is done with the purpose of minimizing the size of the JavaScript, which has to be downloaded by users. For instance so that a Firefox user does not have to load the JavaScript specifically compiled for IE6.
However, especially for small GWT applications it might often be faster to download a single file of say 500kb rather than make two sequential requests first for the 5kb *.nocache.js script and then for the rest of the app (cache.html files, etc.).
This leads me to the question: Is there any framework or procedure to bundle the output of the GWT compiler into a single JavaScript file?
First, you can merge all permutations in a single file by using so-called "soft permutations".
Then, you can inline your *.nocache.js into the HTML host page (e.g. using a JSP's #include directive) to cut one additional request (you might have to add a <meta name=gwt:property content='baseUrl=myapp'> where myapp is the subfolder where the .nocache. files are located).
AFAIK that's what Google are doing for their GWT apps.
Alternatively, you can run the permutation selection on the server-side if you can totally replace the selection script (*.nocache.js) with server-side content negotiation (based on User-Agent and Accept-Language request headers for instance) that can directly generates a <script> tag for the appropriate *.cache.js file (provided you use the xsiframe linker).
AFAIK, Google use all these techniques for their GWT apps (such as Google Groups). For a small app, though, I'm not sure it's worth the effort…
Also, the last two techniques work best when your HTML host page is already dynamic and therefore already non-cacheable; otherwise you're mostly moving the problem, not solving it.
I wonder whether the sso linker can be used when you collapse all properties and soft-permutations down to a single hard permutation.
Yes, but it's maybe not something you want. See this answer: https://stackoverflow.com/a/4453716/66416 to this stackoverflow question: Merge GWT generated files.
I found another way to accomplish this: Writing a custom Linker for GWT. Two examples for linkers which compile into a single JavaScript file are:
GwtNodeLinker.java from Gwt Node project
ServerSingleScriptLinker.java from Env.js project

Set up own DBpedia server to create new mappings

I want to extend the mappings database of DBpedia. Therefore I want to run my own extraction framework instance on my computer. Although the latter is simply done I cannot figure how to feed the framework with newly created mappings.
What I found out so far:
In "config.properties" I can define my own dump-folder.
Some output directory can be defined as well. But what exactly is stored there?
In "Configuration.scala" the url of a mappings page is defined. Does that mean that the framework expects a web page as input which will then be searched for mappings?
My goal is to define some mappings in a plain text file and then tell the extraction framework somehow to use this file as the source of all mappings.
If everything works smoothly I am going to contribute my results to the dbpedia team.
Thanks for your help!
Some output directory can be defined as well. But what exactly is stored there?
The extraction framework outputs N-Triples and N-Quads of all the extracted data, mapping-based and others (see also the files at http://dbpedia.org/Downloads).
In "Configuration.scala" the url of a mappings page is defined. Does that mean that the framework expects a web page as input which will then be searched for mappings?
The Mappings are loaded from http://mappings.dbpedia.org/ which is a wiki for creating and editing mappings. You can get an account and editor rights there and write your own mappings. They will then be loaded when you run the extraction framework (and the data using the mappings will be available in the next release).
My goal is to define some mappings in a plain text file and then tell the extraction framework somehow to use this file as the source of all mappings. If everything works smoothly I am going to contribute my results to the dbpedia team.
You could go ahead and make the framework read the wiki code of mappings from local text files, but I think it would be better to edit them directly on the wiki. Your contribution will be instantly available.

iPhone HTML Parsing using TouchXML and tidy

I'm trying to parse HTML using TouchXML. However, it seems that the data I want to parse (I do not control the source, it's downloaded from the internet) is partially malformed - I get various errors during the parse. Therefore, it seems that I should be using the inbuilt tidy support to fix the HTML but I cannot seem to find any documentation or information on how to enable it or link libtidy successfully into my project.
If anyone has any information on how to do this, it'd be much appreciated. Alternatively if there's another tool I could be using to do this - do tell me!
Actually, you can both link to the framework and include the headers, without needing to download the source.
Link to the existing framework libtidy.dylib
Add /usr/include/tidy to HEADER_SEARCH_PATHS
Turns out that although the framework can be linked in to an xcode project, the headers are missing. I have got around this by downloading the HTML Tidy Source (src and include directory) and added them in to compile as part of my xcode project.