Git Product home page Git Product logo

caddy-expires's People

Contributors

equim-chan avatar hlidotbe avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

caddy-expires's Issues

Caddy's import path has changed

Caddy's import path (and Go module name) has changed from

github.com/mholt/caddy

to

github.com/caddyserver/caddy

Unfortunately, Go modules are not yet mature enough to handle a change like this (see https://golang.org/issue/26904 - "haven't implemented that part yet" but high on priority list for Go 1.14) which caught me off-guard. Using Go module's replace feature didn't act the way I expected, either. Caddy now fails to build with plugins until they update their import paths.

I've hacked a fix into the build server, so downloading Caddy with your plugin from our website should continue working without any changes on your part, for now. However, please take a moment and update your import paths, and do a new deploy on the website, because the workaround involves ignoring module checksums and performing a delicate recursive search-and-replace.

I'm terribly sorry about this. I did a number of tests and dry-runs to ensure the change would be smooth, but apparently some unknown combination of GOPATH, Go modules' lack of maturity, and other hidden variables in the system or environment must have covered up something I missed.

This bash script should make it easy (run it from your project's top-level directory):

find . -name '*.go' | while read -r f; do
	sed -i.bak 's/\/mholt\/caddy/\/caddyserver\/caddy/g' $f && rm $f.bak
done

We use this script in the build server as part of the temporary workaround.

Let me know if you have any questions! Sorry again for the inconvenience.

Plugin is incompatible with cloudflare provider

I tried updating caddy recently, but I had to disable this plugin because it will not work when included together with tls.dns.cloudflare. It works fine when it is used alone.

You can reproduce the problem from your command line using:

curl "https://caddyserver.com/download/linux/amd64?license=personal&telemetry=off&plugins=http.expires,tls.dns.cloudflare"
provisioning build environment: go mod init: exit status 1

Support mime type matching instead of regexes

Some web applications don't always have an extension, I'd like to set expiration header based on the mime type of the query instead of the path.

What would be really awesome is to allow checking any available placeholder (kind of like the rewrite the http.rewrite plugin), but I'm guessing that's much more complex.

Expires header not sufficient to bypass browser caching

This is noticed on Chrome (Version 54.0.2840.71 (64-bit)) and Firefox (49.0.2) on OS X:
The Expires header itself is not enough to persuade the browser to reload a modified page.
In Safari, seems to work as expected.

(Edit: removed comment regarding Last-Modified - was not correct. Added browser info.)

Trying the new build server

Hey @hlidotbe - how can I contact you privately? I want to send you instructions to add your plugin to the new build server before it launches in a bit.

Invalid import path?

Not sure if this is the problem package, but our caddy build has started failing.

starting stage: building caddy                                                                                   
go: downloading github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a                       
go: downloading github.com/dustin/go-humanize v1.0.0                                                             
go: downloading github.com/gorilla/websocket v1.4.0                                                              
go: downloading github.com/naoina/toml v0.1.1                                                                    
go: downloading gopkg.in/yaml.v2 v2.2.2                                                                          
go: extracting github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a                        
go: extracting github.com/dustin/go-humanize v1.0.0                                                              
go: extracting github.com/naoina/toml v0.1.1                                                                     
go: extracting github.com/gorilla/websocket v1.4.0                                                               
go: downloading github.com/naoina/go-stringutil v0.1.0                                                           
go: extracting github.com/naoina/go-stringutil v0.1.0                                                            
go: extracting gopkg.in/yaml.v2 v2.2.2                                                                           
can't load package: package caddy:                                                                               
expires.go:2:10: invalid import path: ""                                                                         
error at 'building caddy'  

Any ideas? Our dockerfile looks like this

FROM abiosoft/caddy:builder AS caddy

ARG version="1.0.1"
ARG plugins="expires,minify,realip,route53"
ARG enable_telemetry="false"

# process wrapper
RUN go get -v github.com/abiosoft/parent
RUN VERSION=${version} PLUGINS=${plugins} ENABLE_TELEMETRY=${enable_telemetry} /bin/sh /usr/bin/builder.sh

(Deleted issue)

(Issue deleted because I had done a mistake and the bug report was invalid.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.