sdgluck / cache-control Goto Github PK
View Code? Open in Web Editor NEWcreate cache-control headers
Home Page: https://cache-control.sdgluck.now.sh
create cache-control headers
Home Page: https://cache-control.sdgluck.now.sh
First of all, great tool! Nice job on this.
In Firefox, the "share | copy" links in the header are being overlaid by the element in the HTML called <div class="resultHeader">
. So in Firefox, you can't actually use those links because they're overlaid by the element due to the margin-top: -40px
in the CSS.
I'm not entirely sure why the same problem doesn't occur in Chrome, because it also seems to be overlaid in that browser, but the links still seem to work there.
only-if-cached
is a request directive, so it seems it'd be incorrect to include it in a response, see https://tools.ietf.org/html/rfc7234#section-5.2.1.7
Whey you use max-age, code that is generated in express shows following:
res.set('Cache-Control', 'max-age 86400');
shouldn't there be =
instead of space, like so
res.set('Cache-Control', 'max-age=86400');
Thank you
Taking Apache as an example, the code output may look like this:
# for all responses <IfModule mod_headers.c> Header set "Cache-Control" 'no-cache' </IfModule> # for single response Header set "Cache-Control" 'no-cache'
Actually both these cases set the header for all responses.
If you want a header only to be included in a response for certain files based on file extension you could use e.g. <FilesMatch>
, or preferably based on MIME type using expr
.
<IfModule mod_headers.c>
# Based on file extension:
<FilesMatch "\.(htm|html)$">
Header set Cache-Control "no-cache"
</FilesMatch>
# Based on MIME-Type:
Header set Cache-Control "no-cache" "expr=%{CONTENT_TYPE} =~ m#text/html#i
</IfModule>
Perhaps there could be an option to choose which MIME-types or file extensions the build should apply to?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.