I want to load .cache.html file of GWT application on client side ( Browser )
but now when I load my application on browser each time .cache.html file is downloaded from the server
I don't want it to be downloaded on each request , because it's too heavy
Please suggest me solution
Thanks
The GWT documentation includes example cache settings for .htaccess on Apache.
<Files *.nocache.*>
ExpiresDefault "access"
</Files>
<Files *.cache.*>
ExpiresDefault "now plus 1 year"
</Files>
You need to configure your server to tell the client to cache that file. All the files with 'cache' in their filename should be configured that way.
It can get a little tricky when you have apache serving as proxy for tomcat. Here is how I am doing it.
Related
I was learning about HTML domains and paths in my computer-science class. However, I have a question. What happens if you only specify a domain, such as apple.com instead of specifying a path? Does the page automatically give you the index file or something?
Thanks :)
That entirely depends on what the web server is configured to do. What you’re doing is you’re requesting a URL from a web server via HTTP. That does not inherently have anything to do with files. The web server can respond to the request in any way it wants.
But yes, most typically the average web server will look for a file named something like index.html in its webroot folder and return it.
yes, there is the default file that is returned if no path is provided
From Apache documentation
Typically, a document called index.html will be served when a directory is requested without a file name being specified. For example, if DocumentRoot is set to /var/www/html and a request is made for http://www.example.com/work/, the file /var/www/html/work/index.html will be served to the client.
From IIS documentation:
Default documents are enabled by default, and IIS 7 defines the following default document files in the ApplicationHost.config file as server-wide defaults: Default.htm, Default.asp, Index.htm, Index.html, Iisstart.htm.
(If you install ASP.NET on your Web server, the installation process will add the Default.aspx file to this list.)
How do I download an htaccess file from another website?
How do I view my own htaccess in my browser?
I have tried to go to www.website.com/.htaccess but no success for example.
I know that there is a command that can be added to the htaccess file to disable viewing but I'm talking about htaccess files that do not include this code.
By default, Apache config has
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ".ht*">
Require all denied
</Files>
So you can't, or you shouldn't be able to. It would be a security problem otherwise.
How do I download an htaccess file from another website?
That's not possible, .htaccess can contain sensitive information, that's why the default configuration prevents access to this file.
How do I view my own htaccess in my browser?
You can modify the server configuration (see how to configure apache to view hidden (.) files?) to unblock access to this file. But if you have access to this configuration, you probably have an access to the file, so you should be able to view it with another tool than your browser.
I have a working website with a verification/login using .htaccess & .htpasswd. When trying to cache it I get the error:
Application Cache Error event: Resource fetch failed (403) http://fman.cf/.htaccess
I'm not sure if their is another way to have an offline verification but here is my Offline.appcache file:
CACHE MANIFEST
# Cache Manifest Version: 1.0
# For Offline Usage
# Reminder: JQuery
CACHE
/Javascript.js
/Styles.css
/RPS.jpg
/RPS.html
/Miji.html
/Murderer.jpeg
/Lottery.png
/403.html
/404.html
/.htaccess
/.htpasswd
/.quarantine/*
/.tmb/*
NETWORK
*
FALLBACK
/404.html
# Last Update:
# 6/2/2015
.htaccess:
# DO NOT REMOVE THIS LINE AND THE LINES BELOW ERRORPAGEID:asdfasdf
ErrorDocument 403 /403.html
# DO NOT REMOVE THIS LINE AND THE LINES ABOVE asdfasdf:ERRORPAGEID
# DO NOT REMOVE THIS LINE AND THE LINES BELOW ERRORPAGEID:adsfasdf
ErrorDocument 404 /404.html
# DO NOT REMOVE THIS LINE AND THE LINES ABOVE asdfasdf:ERRORPAGEID
AddType text/cache-manifest .appcache
# DO NOT REMOVE THIS LINE AND THE LINES BELOW PWPROTECTID:passblahblah
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /home/myid/public_html//.htpasswd
Require user admin
# DO NOT REMOVE THIS LINE AND THE LINES ABOVE blablah:PWPROTECTID
.htpasswd:
USERNAME:MY_PASSWORD
NOTE: All of the comments in the .htaccess were placed their by my hosting service, I did change all the actualy numbers/words/passwords to random stuff.
.htaccess files are not available offline, because the server (Apache) uses them, not the browser. This is an important point which I think you did not understand yet.
The server looks into the file and uses it to offer login, the login itself does not happen in the .htaccess file. A standalone .htaccess file doesn't do anything, it only contains text.
Files starting with .ht are blocked to the public by default Apache configuration.
There is no way you can implement an offline login using HTML.
The .htaccess can be cached serverside in two ways:
Move the configuration to a standalone apache configuration permanently loaded (instead of dynamically loaded .htaccess).
Put the .htaccess file on a ramdisk.
None of those methods would speed up anything significantly, nor would it allow the user to login offline.
Hi I'm trying to use application cache .As it is documented I'm getting a prompt like :
This website() is asking to store data on your computer for offline use .
with 3 options :
1.Allow 2. Never for this website 3. Not now
In my case only 3rd option works .Why?
Here is my html file
<html manifest="example.appcache">
.......
</html>
It's because you:
either are hosting the appcache file locally on your computer, and your computer does not return the correct MIME to your browser: text/cache-manifest
or your server (IIS/Apache) is not configured correctly to deliver the .appcaches files with the correct MIME.
For Apache you need to add this line to your .htaccess
AddType text/cache-manifest .appcache
For IIS, there are tutorials to be found if you search for "appcache IIS MIME"
I am working on an offline application in HTML and am having a problem using the HTML5 manifest. I am able to get it to download all the files and the manifest but when I change the manifest it does not do an update.
I see a record of the browser downloading the manifest in the web server log, and it does issue a bunch of progress events. However there is no record in the web server log of it downloading any of the files listed in the manifest nor do any changes show up in the browser.
This is with firefox 3.6.4.
Any ideas?
The manifest itself is still subject to normal browser caching rules, make sure you serve the manifest files with an expiry header set to immediate. You can do this on Apache in .htaccess with this:
<IfModule mod_expires. c>
ExpiresActive on
ExpiresByType text/cache-manifest “access plus 0 seconds”
</IfModule>
In the short term, try hitting Ctrl+F5 to force a full reload or clearing your browser cache.