Skip to content

Cannot clear pgs cache for "vanity URL" linked to project聽#220

Open

Description

@manuel2a

Greetings!

Repro:

  • Create a pgs project. Nice!
  • Upload a bunch of files under it. Works. Excellent! 馃槑
  • Update a file. The old file still shows up in the browser. 馃
  • Clear the pgs http cache (ssh pgs.sh cache project --write)... The old file still shows up 鈽癸笍
  • Delete the project (ssh pgs.sh rm project --write) then clear the cache for the project... still shows up... 馃槮
Click for log (screenshot) Image

Activity

  1. neurosnap commented on Jul 18, 2026

    @neurosnap
    Member

    Hi! Your browser is caching the file. This is out caching policy for files:

    Cache-Control: "max-age=60, s-maxage=%0.f, must-revalidate"

    "max-age=60, s-maxage=%0.f, must-revalidate",

  2. manuel2a commented on Jul 18, 2026

    @manuel2a
    Author

    Hi! Thanks for the quick response! Not the case... Not client-side caching...

    • I had trouble with one updated html file refreshing. Cleared client and server cache. No joy after 15 min-ish (was expecting instant).
    • deleted the project and cleared server cache. I could confirm (sshfs) that the project was gone.
    • cleared cache in my browser (Firefox). No joy.
    • ran a fresh different browser (Chromium) that had never seen the site. Same.
    • curl (never caches on the client side) was returning ghost pages more than 30 min after I deleted the project + cleared the cache (ssh pgs.sh rm my-project --write then ssh pgs.sh my-project cache --write). The screenshot shows the long gone 404.html.
    • I tried now (about 2h later) and it says project not found which is a good result 馃槂
    • Not sure you have logs that may be helpful with my whole session history? tofinopickleball

    Opinion:

    • You have a timing issue for the propagation of project deletion and clearing the server cache.
    • May be related to the size of the project -- ~60MiB ~600 files.
    • I had a test project earlier (10 times smaller-ish) did not seem instant but was a lot more snappy.

    Let me know if I can help in any way. BTW: I love 鉂わ笍 pico.sh + would really like you guys to be successful with it.

  3. neurosnap commented on Jul 19, 2026

    @neurosnap
    Member

    Thanks for the report. I'll look into this. Could you upload the site to a temporary project and share it with me? I'll use that to test.

  4. manuel2a commented on Jul 20, 2026

    @manuel2a
    Author

    Update: traced it down to the "vanity URL" project. Repro:

    1. Create a new pgs.sh project (tmp). Drop a file ('hello.txt`) in it.
    2. Link the "vanity URL" to this project.
    3. File shows up ok in the tmp project and in the vanity URL. Nice! 馃槑
    4. Change the contents of hello.txt
      • The tmp project shows the modified file 鉁旓笍
      • The vanity URL shows the cached file 馃 . Clearing cache doesn't help.
      • Accessing the "vanity" linked project as {user}-{project}.pgs.sh shows the modified file 鉁旓笍
    Click for full log
    ~/Systems$ ls pico                                    # sshfs mountpoint (now disconnected)
    ~/Systems$ sshfs -o "IdentityFile=~/.ssh/mz" pgs.sh:/ ~/Systems/pico 
    ~/Systems$ ls -l pico                                 # One directory (pgs.sh project)
    total 4
    drwxr-xr-x 1 root root 4096 Jul 19 07:16 img
    ~/Systems$ ssh -i ~/.ssh/mz pgs.sh ls                 # Confirm: one project.
    Name  Last Updated         Links To  ACL Type  ACL  Blocked
    img   2026-07-19 13:45:03            public         
    ~/Systems$ mkdir pico/tmp                             # Create a temporary project "tmp".
    ~/Systems$ ssh -i ~/.ssh/mz pgs.sh ls  # Confirm: two projects.
    Name  Last Updated         Links To  ACL Type  ACL  Blocked
    img   2026-07-19 13:45:03            public         
    tmp   2026-07-20 17:04:36            public         
    ~/Systems$ echo "Hello tmp" > pico/tmp/hello.txt
    ~/Systems$ cat pico/tmp/hello.txt 
    Hello tmp
    ~/Systems$ curl -s https://mz-tmp.pgs.sh/hello.txt      # Nice!
    Hello tmp
    ~/Systems$ ssh -i ~/.ssh/mz pgs.sh link mz --to tmp --write # Link to "vanity" URL (mz.pgs.sh)
    (mz) might have orphaned assets, removing
    removing project assets (mz)
    no assets found for project (mz)
    (mz) now points to (tmp)
    ~/Systems$ curl -s https://mz.pgs.sh/hello.txt          # Nice!
    Hello tmp
    ~/Systems$ ssh -i ~/.ssh/mz pgs.sh link tmpcopy --to tmp --write # Link to another project URL (mz-tmpcopy.pgs.sh)
    (tmpcopy) might have orphaned assets, removing
    removing project assets (tmpcopy)
    no assets found for project (tmpcopy)
    (tmpcopy) now points to (tmp)
    ~/Systems$ curl -s https://mz-tmpcopy.pgs.sh/hello.txt   # Nice!
    Hello tmp
    ~/Systems$ ssh -i ~/.ssh/mz pgs.sh ls  # Confirm: two projects. Two linked projects.
    Name     Last Updated         Links To  ACL Type  ACL  Blocked
    img      2026-07-19 13:45:03            public         
    mz       2026-07-20 17:09:22  tmp       public         
    tmp      2026-07-20 17:04:36            public         
    tmpcopy  2026-07-20 17:11:08  tmp       public         
    ~/Systems$ cat "Hello modified" > pico/tmp/hello.txt 
    cat: 'Hello modified': No such file or directory
    ~/Systems$ echo "Hello modified" > pico/tmp/hello.txt 
    ~/Systems$ curl -s https://mz-tmp.pgs.sh/hello.txt        # Nice!
    Hello modified
    ~/Systems$ curl -s https://mz-tmpcopy.pgs.sh/hello.txt    # Nice!
    Hello modified
    ~/Systems$ curl -s https://mz.pgs.sh/hello.txt            # What?!?
    Hello tmp
    ~/Systems$ ssh -i ~/.ssh/mz pgs.sh cache mz --write
    clearing http cache for mz
    ~/Systems$ curl -s https://mz.pgs.sh/hello.txt            # Clearing cache doesn't help :(
    Hello tmp
    ~/Systems$ curl -s https://mz-mz.pgs.sh/hello.txt      # Surprise!!
    Hello modified
    
    
  5. changed the title [-]Cannot clear pgs cache[/-] [+]Cannot clear pgs cache for "vanity URL" linked to project[/+] on Jul 20, 2026
  6. neurosnap commented on Jul 20, 2026

    @neurosnap
    Member

    Ahh, nice catch! I bet our cache-key is not right for vanity domains. Will work on this asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions